Manaus Posted September 13, 2013 Share Posted September 13, 2013 Hello, simple question: how do I check whether the viewed page is the homepage? if ($page->parent == "NullPage") or something like this? Thanks!! 1 Link to comment Share on other sites More sharing options...
Manaus Posted September 13, 2013 Author Share Posted September 13, 2013 Well found it if $page->path == "/" Link to comment Share on other sites More sharing options...
WillyC Posted September 13, 2013 Share Posted September 13, 2013 if( $page->id == 1 ) 3 Link to comment Share on other sites More sharing options...
diogo Posted September 13, 2013 Share Posted September 13, 2013 (edited) if( $page === $pages->get(1) ) Edited May 25, 2015 by diogo corrected $page->get to $pages->get Link to comment Share on other sites More sharing options...
Martijn Geerts Posted September 13, 2013 Share Posted September 13, 2013 if($page->parents->count() === 0) { echo "you are at home"; } Link to comment Share on other sites More sharing options...
onjegolders Posted September 13, 2013 Share Posted September 13, 2013 if ($page->isTheDamnHomePage == 1) { echo "Welcome Home"; } Sorry, that's not a real one. I blame it on Friday afternoon and a lack of sleep... 1 1 Link to comment Share on other sites More sharing options...
Martijn Geerts Posted September 13, 2013 Share Posted September 13, 2013 Yeah.... if(rtrim(floor(( $config->permissionTemplateID * $config->guestUserPageID ) / $config->http404PageID ) + $config->trashPageID, 4) == 1 ) { echo "you are at home"; } 4 Link to comment Share on other sites More sharing options...
onjegolders Posted September 13, 2013 Share Posted September 13, 2013 Brilliant Link to comment Share on other sites More sharing options...
Manaus Posted September 13, 2013 Author Share Posted September 13, 2013 Aha great community thanks guys 1 Link to comment Share on other sites More sharing options...
diogo Posted September 13, 2013 Share Posted September 13, 2013 if ($page->children->first()->parent->id === $page->get(28)->parent->id - 1) 1 Link to comment Share on other sites More sharing options...
GeraldSchmidt Posted May 25, 2015 Share Posted May 25, 2015 if( $page === $page->get(1) ) It's an older post but let me correct this anyway if( $page === $pages->get(1) ) 1 Link to comment Share on other sites More sharing options...
diogo Posted May 25, 2015 Share Posted May 25, 2015 Thanks! Corrected my old post, in case someone stumbles on this Link to comment Share on other sites More sharing options...
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