I have a small menu of fixed entries that forms a sub-nav on a site.
I'm currently using Reference Tag parsing to grab links to these entries:
<li><a href="{{ '{entry:3666:url}' | parseRefs }}">Help</a></li>
<li><a href="{{ '{entry:3667:url}' | parseRefs }}">Donate</a></li>
<li><a href="{{ '{entry:3668:url}' | parseRefs }}">About Us</a></li>
I think this is a really clean/readable way to create this sub-nav, but I'm not sure about the performance implications. I could accomplish the same thing by calling up an ElementCriteriaModel using a fixedOrder:
{% entries = craft.entries.id(3666, 3667, 3668).fixedOrder(true) %}
{% for entry in entries %}
<li><a href="{{ entry.url }}">{{ entry.title }}</a></li>
{% endfor %}
Does anybody know if one option is significantly performant over the other?
(I wouldn't be surprised if Craft is intelligently caching its entry data queries, such that it wouldn't have to create a new element query each time a Reference Tag is encountered/parsed... but I'm not knowledgable enough to say.)
Other SE questions about best-practice for linking to single entries: