On the website I am building I have these three pages:
- http://janhekmanschool.nl/nieuws/
- http://janhekmanschool.nl/nieuws/huisvesting/
- http://janhekmanschool.nl/nieuws/2009/
When {segment_2} ends with a year it must show the archive of that year and when {segment_2} is not a year it must show that post.
But how do I target it?
In my template I have this:
<div id="content_main">
{embed="_includes/.article" location="{template_group}"}
</div><!-- /content_main -->Which loads this:
<div class="article">
{exp:weblog:entries weblog="{embed:location}" limit="1" orderby="date" sort="desc" disable="categories|member_data|pagination|trackbacks"}
<div class="article_header">
{if segment_1 == "nieuws" && segment_2==year}
<h1>Nieuwsarchief {segment_2}</h1>
{if:else}
<h1>{title} {if segment_1 == "nieuws|nieuwsbrief"} <span>{entry_date format="%d %F %Y"}</span>{/if}</h1>
{/if}
</div><!-- /article_header -->
{if segment_1 == "nieuws" && segment_2 != ""}
{body_nieuws}
{if:else}
{body}
{/if}
{/exp:weblog:entries}
</div><!-- /article -->I tried something with this kind of code but all failed:
{if segment_1 == "nieuws" && segment_2==year}It failed I think because when you want segment_2==year it has to be wrapped inside {exp:weblog:entries or am I wrong?
I hope someone that what I want is possible…