If you need a quick answer on how to do something with Craft CMS, you’re in the right place.

or browse the recipes

Newest Recipes

Text Columns

You want to create multiple columns from a text string

Read the full recipe →

Fully Dynamic Hierarchical Nav Menu Template

You want to output a navigation menu that automatically lists a Structure Section’s page hierarchy, with various CSS classes that indicate current page, current section, has children, etc.

Read the full recipe →

Breadcrumbs

You want to easily add automatic breadcrumbs to your website.

Read the full recipe →

Multiple Template Variables in Plugin Development

You want your plugin to have multiple template variables.

Read the full recipe →

Image Transforms on the Fly

You want to perform transforms for assets dynamically without having to define them ahead of time.

Read the full recipe →

Category Group Based Tabs (grouping entries by categories)

How to group entries, dynamically, using a category group. Useful for outputting category-based tabs.

Read the full recipe →

Get Model/Record attributes in variable types specified by defineAttributes()

When Craft returns BaseModel and BaseRecord attributes, it unfortunately doesn’t return them in the variables types specified by the Model/Record’s defineAttributes method.

Read the full recipe →

Show link to edit entry

You want to expose a link to edit an entry, only showing the link if the logged-in user has permission to edit that Section’s entries.

Read the full recipe →

Remove elements from the last iteration a loop

You have a series of related entries outputting within a loop and are comma separated but you don’t want a comma on the last loop item.

For example, I have a list of sessions and attached to each session is a speaker or speakers. I want the speaker names comma separated if there is more than one but I don’t wish the comma on the last speaker.

Read the full recipe →

Setting a folder path dynamically in different environments

You want to set a folder path absolutely, without hardcoding the absolute path

Read the full recipe →

Join Our Monthly Newsletter

Never miss a trick (or tip). Our newsletter contains every recipe added to Craft Cookbook in the previous month.

gipoco.com is neither affiliated with the authors of this page nor responsible for its contents. This is a safe-cache copy of the original web site.