Simon East
  • Member for 5 years, 5 months
  • Last seen more than 1 year ago
The Definitive Guide to Extending Twig in Craft CMS
14 votes

To encourage input, this is a community wiki post. Any user with at least 100 reputation points may contribute. Functions, filters, objects, macros and statements – when to use which A function is ...

View answer
Filter Entries by Field Value
11 votes

Filtering a list of entries is quite simple. Here's an example from one of our sites: {% for job in craft.entries({ section: 'jobs', applicationsClose: ">= " ~ (now|date('Y-m-d')), ...

View answer
Matrix fields within matrix field
7 votes

As of 2016, I have come across two options that attempt to handle the matrix-within-a-matrix scenario (to varying extents): Neo plugin https://github.com/benjamminf/craft-neo Provides the ability to ...

View answer
Plug-ins for static hosting?
Accepted answer
4 votes

Perhaps you could have a local/internal Craft install and then regularly run a script that crawls the site and saves all the pages as static HTML. Tools like HTTrack already do a pretty good job of ...

View answer
Cache issues making site super slow in production but not in dev mode
4 votes

For others that might be facing an issue similar to this – we found that our Craft site was gradually getting slower and slower over a period of several days, despite using the {% cache %} tag. When ...

View answer
Editorial workflow / custom status
4 votes

Douglas has posted a great suggestion about creating an additional custom field for "Status". But I think it's also worth mentioning Josh Crawford's great free plugin called Workflow which takes Craft'...

View answer
Smart quotes in rich text fields?
2 votes

There's also another great plugin I came across recently called Typogrify. It also supports SmartyPants (as mentioned in another answer) along with several other nice typography improvements: Uses ...

View answer
Is it possible to bulk-edit a field across multiple entries at once?
2 votes

This has been requested in the Craft feedback forum (vote for it if you like, here and here). But as of Jan 2017, there is no functionality for this in a default Craft install. The closest thing I've ...

View answer
Use <span> in Redactor
2 votes

It appears that Craft filters out <span> tags by default. You can control this in two ways: By disabling the "Clean up HTML" setting applied to the custom field For more control, you can ...

View answer
Getting logged out of admin area when refreshing site
1 votes

As Brad Bell mentioned in this answer: It can be that wherever Apache/PHP is configured to save session files doesn't exist or isn't writable. If you've got the overridePhpSessionLocation config ...

View answer
How would you recommend integrating craft with Algolia
1 votes

There is an open-source Craft 2.x plugin for Algolia: https://github.com/joshuabaker/craft-algolia I haven't used it, but it would be a good place to start.

View answer
How do I set Redactor formatting button to wrap selected text in two tags? <pre><code>...</code></pre>
1 votes

I don't have the code handy, but a simple workaround might be to setup Redactor to use just one of the tags (either <pre> or <code>) and then replace these tags on the fly within your Twig ...

View answer
How to improve unexpectedly poor Craft performance?
1 votes

As described in this thread, we found that our Craft site was gradually getting slower and slower over a period of several days, despite using the {% cache %} tag. When we cleared the template cache, ...

View answer
Does Craft Have Publishing Workflow?
1 votes

As MISC has mentioned, Craft has a great permissions system built-in, which allows you to assign users the ability to either publish content live, or instead only create it and have others publish it. ...

View answer
Custom fields on a structure or section archive page
1 votes

There are three ways you can make that page editable: Create "Global" custom fields which are then pulled into that specific template. This may not be overly intuitive for the administrator, however, ...

View answer
Live preview not automatically updating
1 votes

Brad & Matt provided good suggestions, but we just found another case where this can happen – when using matrix blocks with special filters or conditions. In Craft 2.6 I found that this line does ...

View answer
Advanced layout: Best way to create a tabbed page with variable content in each tab
1 votes

As Brandon mentioned in 2014, this is a good case for Matrix-within-a-Matrix. Until that functionality gets added into core, the following two plugins are your best bet: Neo plugin https://github.com/...

View answer
Comments being overwritten on save
1 votes

As @carlcs mentioned, it's likely due to the way you're saving the ID... <input type="hidden" name="entryId" value="{{ entry.id }}"> I would omit this line to ensure you save a new comment ...

View answer