Page 1 of 1
Navigator hide current page
Posted: Tue Aug 23, 2022 7:19 pm
by oakstreet
Hey there,
I am creating a recipe website and want to hide the current page on the navigator menu. Im pretty sure there is an easy way to do this using the design template, omitting the active page, but my brain is wired upside down today and I can't seem to find it. Help below is clearly not it?
Code: Select all
{Navigator template='bandb_topnav' childrenof='oktoberfest-recipes' current='false'}
Re: Navigator hide current page
Posted: Tue Aug 23, 2022 7:31 pm
by Dr.CSS
I think the best way would be to use CSS to hide it...
.current-page { visibility: hidden}
Re: Navigator hide current page
Posted: Tue Aug 23, 2022 8:09 pm
by oakstreet
wouldn't that still take up space in the navigation?
Re: Navigator hide current page
Posted: Tue Aug 23, 2022 8:34 pm
by oakstreet
So I found out how to remove the current page using its specific alias using excludeprefix="". I was hoping It could trigger the active page. That way I wouldn't have to change the code for each page.
Re: Navigator hide current page
Posted: Tue Aug 23, 2022 8:54 pm
by DIGI3
Assuming the Navigator call is in your template, you can exlude_prefix=$page_alias, which will exclude the current page.
If the Navigator call is in your page content, then you'd either have to edit the tag on each page to include that parameter, or edit your Navigator template to exclude the current page {if $page_alias == $node->alias}don't do anything{else}do stuff{/if}
You can also just hide it with css as mentioned, it doesn't "take up space" if it's hidden - unless you're talking about the actual code existing - which is pretty minor in the grand scheme of things.
Re: Navigator hide current page
Posted: Tue Aug 23, 2022 9:04 pm
by oakstreet
Thank you, that answers my question.