Jump to content

Hide children of home from indexing (Single Page Site)


alexm
 Share

Recommended Posts

  • 1 month later...

Just as a general note (since I got here by looking for something else), you can use Diogo's line if you are rendering a child page into a parent, for example, but don't want all of it. So:

<?php

if($page->url == $_SERVER['REQUEST_URI']) {

   echo "some header code";

}

   echo "Something nice here";

if($page->url == $_SERVER['REQUEST_URI'])  {

   echo "some footer code";

} 

?>

So, when the page is rendered in as part of another page (perhaps its parent), the header and footer will not be rendered. But if the page is called directly, they will.

Sorry, a very little bit off track, but related.

Link to comment
Share on other sites

Sorry folks if I miss the point here, but @alexmercenary why don't you simply use a template without template file for your children? From my understanding of what you want to achieve that should do the trick.

Sent from mobile

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...