Variable for "homepage"
fr3em1nd
✭✭
hi guys, what's the variable for "homepage" ?
example :
`if(hompage()){
//this that can be seen only in frontpage 
}`
i've searched throught forums and codes, i cant find any.
0
Comments
not really.
play around with these variables and you should be able to figure something out.
$qs = ($_SERVER[QUERY_STRING]); $uri = $_SERVER['REQUEST_URI']; $Surl = $Sender->SelfUrl; $URL(); if (($qs == "") || ( something == "youhomepage")) { // do something }I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
Ha funny! I used peregrine's ExtraPage plugin and called it my FrontPage and designated it the alternative homepage. This probably is irrelevant but my head thinks different ...
❌ ✊ ♥. ¸. ••. ¸♥¸. ••. ¸♥ ✊ ❌
If you need to get your default Home page (to check what '/' actually is):
$Routes=&Gdn::Router()->Routes;
$DefaultHomePage = $Routes['DefaultController']['Destination'];
I think you are thinking too much like wordpress.
You can check it like so
if(strcasecmp(C('Routes.DefaultController').'controller',Gdn::Controller()->ControllerName)==0){ }edit I changed it.
grep is your friend.
I would use hooks where possible though.
grep is your friend.