I'm trying to generate a sitemap and wish to output all the entries that have a section type of 'single' but can't get the the correct syntax.
All of the entries need to return 'single' for {entry.section.type}
.
{# This query doesn't work but hopefully helps demo the above question #}
{% for entry in craft.entries.section({'type':'single'}).order('id asc') %}
<url>
<loc>{{ entry.url }}</loc>
<lastmod>{{ entry.dateUpdated.atom }}</lastmod>
<changefreq>weekly</changefreq>
{% if entry.section.isHomepage() %}
<priority>1</priority>
{% else %}
<priority>0.8</priority>
{% endif %}
</url>
{% endfor %}
Edit:
This query does work but it's a slow bad way of doing it as it gets EVERY entry and filters after the fact:
{% for entry in craft.entries.order('id asc') if entry.section.type == "single" %}
<url>
<loc>{{ entry.url }}</loc>
<changefreq>weekly</changefreq>
{% if entry.section.isHomepage() %}
<priority>1</priority>
{% else %}
<priority>0.8</priority>
{% endif %}
</url>
{% endfor %}