Jump to content

Search the Community

Showing results for tags 'render children'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to ProcessWire
    • News & Announcements
    • Showcase
    • Wishlist & Roadmap
  • Community Support
    • Getting Started
    • Tutorials
    • FAQs
    • General Support
    • API & Templates
    • Modules/Plugins
    • Themes and Profiles
    • Multi-Language Support
    • Security
    • Jobs
  • Off Topic
    • Pub
    • Dev Talk

Product Groups

  • Form Builder
  • ProFields
  • ProCache
  • ProMailer
  • Login Register Pro
  • ProDrafts
  • ListerPro
  • ProDevTools
  • Likes
  • Custom Development

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests

Found 1 result

  1. 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.
×
×
  • Create New...