Single page website. Navigation based on a Structure section (anchor links). Entries depend on entryTypes.
{# set each section ID with for anchor navigation #}
{% for page in craft.entries.section('pages') %}
<section id ="{{ page.slug }}">
{# check the slug to get the Matrix entries related to the (html) section ID #}
{% if page.slug == 'home' %}
{# get the entries for the entry.type #}
{% set entries = craft.entries.type('pagesHome') %}
{# loop through the block types and entries #}
{% for block in page.matrixFieldHandle.type('matrixBlockHandle') %}
{{ block.title }}
{% endfor %}
{% endif %}
{# and so on.... #}
{% if page.slug == 'about' %}
......
{% endif %}
</section>
{% endfor %}
Questions: am I setting up this single page website in a too complicated way with too many DB queries? Thanks for suggestions!