How can I hide a specific navigation page on my website for non-logged in customers?

Hi,

I need to hide a navigation page from my website. If a customer is logged in the page (in this case “My bookings”) should be visible in the nav bar else the “My bookings” page will be hidden.
I am right now using the Debut theme, and in header-liquid → site_nav.liquid I can find the linked list which is looped through to setup the navigation pages.

I am looking at the liquid cheat sheet and cant find a link.hide option.
The code I have written now does not work, but I hope someone can help me fix this.


  {% for link in linklists[linklist].links %}​  

{% if customer %}
  	{% if link.title == "My bookings" %}
  		{% link.hide %}
  	{% endif %}
  {% endif %}​

in the debut theme.
I found a similiar question in the forum, but there an App from the shopify app store was recommended ($10/month), which is kinda pricey for a simple problem like this.

Thanks.

Hello @SPJVR ,

There are different ways to do it. The simple 2 are:

{% if customer %}
  	{% if link.title == "My bookings" %}
  	
  	{% endif %}
  {% endif %}​

Use this one before in theme.liquid


Note: Change “my-bookings” a/to the URL you have.

Thanks

Thank you so much Guleria, both options worked and got the job done for me!