Hello,
I'm using PW 2.4.11 with its delegate template approach.
I have a page "places" with template places.php to list all its sub pages
<?php
//template places
foreach ($page->children as $child) {
$content .= $child->render();
};
?>
All sub-pages of "places" have the place.php template
<?php
//template place
$tags = '';
foreach ($page->tags as $tag) {
$tags .= "<li><a href='#'>{$tag->title}</a></li>\n";
}
$content = "<article class='article'>\n";
$content .= "<ul class='nav nav-pills'>\n$tags</ul>\n";
$content .= "<h2>{$page->title}</h2>\n";
$content .= "{$page->body}";
$content .= "</article>";
?>
Problem is that for every sub page the whole _main.php gets rendered.
I guess this happens because of
$useMain = true;
in _init.php.
How can I tell the place.php template to only include _main.php when it is not called through the render() method?
If I add
$useMain = false;
to place.php, I get a blank page.
I'm sure the solution must be really simple. But for me not being a coder, I just can't seem to get my head around it.