Skip to main content

Hi there, I need to check whether we are on the portal homepage and display different class names, is there a liquid snippet available for that?


Something like


{% if portal.home %}


<!--Do Something Cool-->


{% endif %}


Thanks!

You can use current_tab

 

{% if portal.current_tab == "home" %}

Cool stuff

{% endif %}

 



Or on current_page



{% if portal.current_page == "topic_list" %}

Cool stuff

{% endif %}

 

To check for the exact placeholder names you can use just put the following lines on top of your page and go the frontend in your browser.

 

Current page: {% portal.current_page %}

Current tab: {% portal.current_tab %}