Jump to content

How to get the current Theme Template ?

Go to solution Solved by Alexandru,

Recommended Posts


I added a new theme template to store all my carousel information in it. ( Or any content in general )

Now I want this to show only in home page where it is the index for my forums.

What is the condition to put that checks which template is now showing ( view ).



my template is called:

{template="mainsitecarousel" app="core" group="_mycustomtheme" location="front"}

I want it to be visible when user is showing the "index" template from forums.

Now I could write the previous code in side it, but I want it to be in different place ( under header ).

My thinking is to add my code in the main globalTemplate with a condition to check if we are in index template or not.

So I need to know what is the expression for that.


My code then will be like this ...

{{if [expression]}}
    {template="mainsitecarousel" app="core" group="_mycustomtheme" location="front"}


Also, is there a place where I can check for these kind of advanced coding in documentation ?


Thank you.

Link to comment
Share on other sites

  • Solution

Sorry. My bad didn’t really read it all.

try this 

{{if request.controller == index && request.module == forums}}} your code here {{else}} code2…{{endif}}

i don’t know if the controller or the module is correct. But press on inspect when you are on your front page, and on the body tag just look for page controller and pagemodule and replace them in the conditions above if not correct. So this code will only show that template on the homepage.

Edited by drawncodes
Link to comment
Share on other sites

Thanks it worked.


Is there a place in documentation where I can learn more about these conditions that are related to the system ? I know how php works here but I don't know what to check when I need somthing, like user information variable or what other things available like this "request.controller".

Link to comment
Share on other sites

  • Recently Browsing   0 members

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