IF/ELSE Liquid snippet to check for homepage

  • 4 February 2016
  • 1 reply

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 %}


This topic has been closed for comments

1 reply

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 %}