Hi,
When I run this code, the count is always 0.
But when I replace within the EOS, page_title="{$title}" with page_title="This is the page title" (remove the manual set php variable) I get a valid count number.
I was using KK's post as reference: https://www.couchcms.com/forum/viewtopic.php?f=4&p=19828#p19829 and this will be in a foreach loop where the title will pull from an array.
Any ideas what I am doing wrong?
When I run this code, the count is always 0.
- Code: Select all
<cms:php>
global $FUNCS;
$title = 'This is the page title';
$tag = 'cms:pages';
$html =<<<EOS
<$tag
_masterpage='clonablepages.php'
page_title='{$title}'
show_future_entries='1'
count_only='1'
/>
EOS;
$count = $FUNCS->embed($html, $is_code=1);
if($count == 0) {
//Nothing found, do something.
}
</cms:php>
But when I replace within the EOS, page_title="{$title}" with page_title="This is the page title" (remove the manual set php variable) I get a valid count number.
I was using KK's post as reference: https://www.couchcms.com/forum/viewtopic.php?f=4&p=19828#p19829 and this will be in a foreach loop where the title will pull from an array.
Any ideas what I am doing wrong?