Maybe I am missing something, but I really cant figure out why the zebra tag isn't working for me. This is my code:
Sorry about the long code. But shouldn't the zebra tag work here? To alternate between the div classes? All it does is add the article_left class to all the divs.
- Code: Select all
<cms:query sql=" SELECT p.id pid, t.name tname
FROM <cms:php>echo K_TBL_PAGES;</cms:php> p
inner join <cms:php>echo K_TBL_TEMPLATES;</cms:php> t
on p.template_id = t.id
WHERE (t.name='artikkel.php' or t.name='anmeldelse.php' or t.name='video.php')
AND publish_date < '<cms:date format='Y-m-d H:i:s' />'
AND NOT publish_date = '0000-00-00 00:00:00'
ORDER BY publish_date desc;" limit='4' offset='1'>
<cms:pages masterpage=tname id=pid>
<div class="<cms:zebra 'article_left' 'article_right' />">
<div class="article_image_normal">
<a href="<cms:show k_page_link />" class="imglink">
<img src="<cms:if k_template_name='artikkel.php' ><cms:show artikkel_bilde /></cms:if><cms:if k_template_name='anmeldelse.php' ><cms:show anmeldelse_bilde /></cms:if>" class="imglink">
</a>
</div>
<p>
<cms:if k_template_name='anmeldelse.php'>Anmeldelse</cms:if>
<cms:if k_template_name='artikkel.php'>Artikkel</cms:if>
<cms:if k_template_name='video.php'>Video</cms:if> / <a href="<cms:show k_site_link /><cms:if k_template_name='anmeldelse.php' >anmeldelse/</cms:if><cms:if k_template_name='artikkel.php' >artikkel/</cms:if><cms:show k_page_foldername />">
<cms:show k_page_foldertitle /></a>
</p>
<h3><a href="<cms:show k_page_link />">
<cms:show k_page_title /></a></h3>
<p>
<cms:excerpt count='150' truncate_chars='1'>
<cms:if k_template_name='artikkel.php'>
<cms:show artikkel_korttekst />
</cms:if>
<cms:if k_template_name='anmeldelse.php'>
<cms:show anmeldelse_korttekst />
</cms:if>
</cms:excerpt>
</p>
</div>
</cms:pages>
</cms:query>
Sorry about the long code. But shouldn't the zebra tag work here? To alternate between the div classes? All it does is add the article_left class to all the divs.