Jump to content

Recommended Posts

Posted

Ah diogo is right

if($page->url == $page->url)

is not same

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

in the context of being rendered by render() :)

  • 1 month later...
Posted

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.

Posted

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

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
  • Recently Browsing   0 members

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