Jump to content

bytesource

Members
  • Posts

    220
  • Joined

  • Last visited

Everything posted by bytesource

  1. Hi Martijn, Thanks a lot for your help! Your suggestion reminded me to take a closer look at the Selectors API. There I found 'include=hidden', which might be an even better fit for my use case. Using this selector, unpublished pages won't be included. By the way, do you if there is a way to set all pages that are attached to a certain template to be hidden (or any other status) by default?
  2. Hi Everyone, I have a page with the following template: product.php <h1><?php echo $page->title; ?></h1> <p><?php echo $page->introduction; ?></p> <?php $children = $page->children; if(count($children)) { foreach($children as $item) { echo $item->render(); // output template associated with item page } } ?> <br style='clear: both;' /> that renders one or more child pages: item.php <h2><?php echo $page->title; ?></h2> <p><?php echo $page->introduction; ?></p> These child pages are not supposed to be accessed by their URL, as they only provide content and markup to the parent page. Setting them to hidden does not work, because then they won't be found as children anymore. I could just use a no_file template and then add the markup for the child pages directly to the parent's template file (product.php), but I prefer to keep this markup in a separate file. Is there a way to solve this problem? Any suggestions are highly welcome!
×
×
  • Create New...