Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
0 votes
in Q2A Core by
What conditional tag is being used to wether you are on the frontpage or not?

I am trying to implement some things that only should be visible on the frontpage...

1 Answer

+1 vote
Best answer

You need to check $this->template. On the homepage it will be 'qa', so for example:

if ($this->template == 'qa')
    // do stuff

(It used to be blank in v1.3 and before.)

Other pages are 'question' for question lists, 'ask' when a user is asking a question, 'tags', 'users' and 'search' should be obvious, and 'custom' for any custom pages you make. You can also check $this->request for the exact page (useful for custom pages).

thanks, that worked!