Soma Posted March 25, 2014 Posted March 25, 2014 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()
Joss Posted April 30, 2014 Posted April 30, 2014 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.
totoff Posted April 30, 2014 Posted April 30, 2014 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now