So, on the site I have two types of post a link list item and an article item. For the front page of the site I need to use 2 different templates for the getResources call, one for the linked list and one for articles.
Articles have a unique templateVariable. At the moment I am using the If snippet to check for the templateVariable in the articles page.
The big problem I have is that all templateVariables have to be called in the chunk before the IF snippet, this adds a lot of extra junk onto the page.
Does anyone have a better way of doing this so I don't have to call all these TVs before?
If you're not to sure, the URL is johnnye.net and check the source.
The snippet I need improving is:
<!--[[+pagetitle]][[+id]][[+content]][[+publishedon:strtotime:date=`%a, %d %B %Y`]][[+tv.articleStyle]][[+tv.linkURL]]-->
[[!If? &subject=`[[+tv.articleStyle]]`
&operator=`notempty`
&then=`<div class="clear"></div><hr><a href="[[~[[+id]]]]"><h1>[[+pagetitle]]</h1></a>
<p class="date">Published on: [[+publishedon:strtotime:date=`%a, %d %B %Y`]]</p>
<div class="[[+tv.articleStyle]]">
[[+content]]
</div><hr>`
&else=`
<div class="link-item">
<a href="[[+tv.linkURL]]"><h2>[[+pagetitle]]</h2></a>
[[+content]]
</div>`
]]