Hey there,
I’m trying to do three different page layouts if the index template for my channel is accessed (category, year/month or none), and this is what I’ve come up with:
{exp:channel:entries channel="blog" limit="30"}
{if category_request}
.... template code for categories .....
{if:else}
{if segment_3 == "{year}" AND segment_4 == "{month}"}
{date_heading display="monthly"}Entries from {entry_date format="%F %Y"}{/date_heading}
.... template code for date stuff ....
{if:else}
..... template code for frontpage (no cat or date) ....
{exp:channel:entries channel="blog" limit="1"}
.... HEADLINER CODE ....
{/exp:channel:entries}
... some (nonchannel) stuff that can't be repeated every top loop ...
{exp:channel:entries channel="blog" limit="3" offset="3"}
... SUBHEAD STYLED ENTRIES ....
{/exp:channel:entries}
.... MORE CUSTOM (nonchannel) STUFF THAT CAN'T BE LOOPED ....
{exp:channel:entries channel="blog" limit="10" offset="10"}
.... list of entries ...
{/exp:channel:entries}
{/if}
{/if}
{/exp:channel:entries}The problem is that the frontpage code keeps getting looped from the higher loop. Is there a way that I can just tell that the template isn’t called in categories or archive mode, and do my stuff outside the top loop? (It seems like I have to call a channel dynamically to have access to the {category_request} and {year} {month} stuff.
Any help would be appreciated!
M.