Frontend.services
  • Cookie policy (EU)
  • Frontend development
  • Privacy Policy
  • Quick Code
Select Page

Programmatically Create New Category in Craft CMS

by matotominac | Apr 5, 2018 | Quick Code | Craft CMS, plugin development

// First we create empty category model $newCategory = new CategoryModel(); // Now we assign our new category to category group. // You can find category group id in /admin/settings/categories. $newCategory->groupId = $categoryGroupId; // Give our new category a...
Next Entries »

Recent Posts

  • Check if Specific Gutenberg Block Exists on Page
  • Automatically set WordPress post title on save
  • (Truly) Responsive Slick Slider Code
  • How to trigger 404 error from custom plugin in Craft CMS 3
  • Clear the cart before adding new product in Craft Commerce

Archives

  • January 2020
  • July 2019
  • March 2019
  • June 2018
  • April 2018

Categories

  • Quick Code
Manage Cookie Consent
We use cookies to optimize our website and our service.
Functional cookies Always active
The technical storage or access is strictly necessary for the legitimate purpose of enabling the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
The technical storage or access that is used exclusively for statistical purposes. The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes.
Manage options Manage services Manage {vendor_count} vendors Read more about these purposes
View preferences
{title} {title} {title}