Skip to main content

Unpublish Top Nav on home page

How do you remove the Top Nav menu for the home page? I want to move the content slider up and just publish main 'action' buttons. Join Volunteer Donate underneath the content slider.

And can someone show me what 'module' positions are available on the Victory Again template. I'm used to using Joomla and can publish 'modules - snippets of content in many different positions on any page. Can you do this in a NationBuilder stock theme template.

Official response from

The top nav is displayed on each page because the Layout.html file in the website theme, which controls what every page looks like, includes the following include tag:

{% include "nav" %}

 

Removing this would indeed remove it from every page, but if you would like to remove it from JUST the homepage, you could surround it with a liquid conditional statement instead of removing it completely. Like this:

{% unless page.is_homepage? == true %}{% include "nav" %}{% endunless %}

 

This will show the Top Nav on the page UNLESS the page you are viewing is the homepage. Similarly, the "IF" liquid logic works as well:


{% if page.is_homepage? == false %}{% include "nav" %}{% endif %}

 

Lastly, it is worth noting that the "page.is_homepage?" variable is useful in this instance but would not help if we were trying to hide an element from a different page on your site. In that scenario, you could use page.slug. For example:

{% if page.slug == "donate" %}{% else %}{% include "nav" %}{% endif %}

Share this post

Showing 3 reactions

How would you tag this suggestion?
Please check your e-mail for a link to activate your account.
Back to top