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:
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.
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>