Problems, need help? Have a tip or advice? Post it here.
2 posts Page 1 of 1
Hi,
On my site I have 3 clonable templates (news.php, reviews.php and videos.php).

I use this code to fetch all cloned pages into one list:
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='news.php' or t.name='reviews.php' or t.name='videos.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='6'>


This works fine. But the problem is that I only want to fetch pages from the videos.php template where a checkbox called video_frontpage is true. Is this possible at all?

I use this code to list the pages, but it seems to fetch all pages from all the templates.

Code: Select all
<cms:pages masterpage=tname id=pid>
<cms:if (k_template_name='video.php') && (video_frontpage)>
...videos code...
</cms:if>

<cms:if (k_template_name='news.php') || (k_template_name='reviews.php')>
...news/reviews code...
</cms:if>
</cms:pages>
Hi,

Please try putting in a <cms:dump /> for only the video template and make sure that the 'video_frontpage' variable is indeed available (and also observe its value as the pages get listed) -
Code: Select all
<cms:if k_template_name='video.php' >
    <cms:dump />
</cms:if>

I think that should yield a clue as to what could be the problem.

Hope it helps.
2 posts Page 1 of 1