Avoiding Whitespace Between Elements
You are using inline-block for grids or lists, browsers interpret whitespace in your code and you end up with small spaces between elements in your layout. Here is how to avoid that problem in your Craft loops.
You are using inline-block for grids or lists, browsers interpret whitespace in your code and you end up with small spaces between elements in your layout. Here is how to avoid that problem in your Craft loops.
You want to pass a tag to an URL slug to only show entries related to that tag.
You’re using tags to categorize your posts and have navigation for those tags/categories where you want to set the active state of the tag you’re currently viewing based on the URL.
You have a list of entries and want to split that into two columns in your markup.
You want to get up and running with a new Craft site in 5 minutes then dokku on DigitalOcean is your friend.
Selecting a random entry.
When transforming and cropping images you’re usually forced to choose one crop position for all images used in a certain place in your template.
This could yield poor results in images where the focal point is very different from your predefined crop position. Here’s a simple solution for letting the client choose this on a per-image basis.
A simple filter by date in the original query so you don’t have to loop through all the entries and manually filter out upcoming events.
There are many ways to build dynamic navigation using craft, but often you want to combine entries across sections into one universal menu. Using this method makes a dedicated menu section that behaves like Nav-ee or Taxonomy in ExpressionEngine (but built-in of course)!
When looping through entries, you want to do something different every x items.