On my search results page I want to add a section filter depending on the different sections that are included in all of the returned entries.
I am getting all the sections like this:
{% set entries = craft.entries.section(['inspirationArticles', 'pages', 'pressArticles', 'products']).search(searchQuery).order('score') %}
{% set entrySections = entries.getAllSections() %}
And then loop through them:
{% for entrySection in entrySections %}
...
{% endfor %}
But when trying to access the sections’s names or handles via {{ entrySection.name }} or {{ entrySection.handle }}, I get a CException error:
Craft\EntryModel and its behaviors do not have a method or closure named "handle".
So it looks like it isn't actually accessing the SectionModel. Am I missing a step?
for loopto get to the sections’ details, but that's just me being picky ;) – Katrin Jun 12 '15 at 17:36