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.
You want to easily add automatic breadcrumbs to your website.
You want your plugin to have multiple template variables.
You want to perform transforms for assets dynamically without having to define them ahead of time.
How to group entries, dynamically, using a category group. Useful for outputting category-based tabs.
When Craft returns
BaseRecord attributes, it doesn’t return them in the variables types specified by the
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.
You want to set a folder path absolutely, without hardcoding the absolute path.
You have a bunch of entries with a category field accepting only one category and you want to order and group those entries by category.
This code snippet supports dynamic environment configuration using either the
APP_ENV environment variable, or “Laravel-style” server name resolution as a fallback.