Skip to content
This repository has been archived by the owner on Nov 16, 2020. It is now read-only.

Hide pages

memowe edited this page Mar 2, 2012 · 4 revisions

How to hide pages from the automagically generated navigation

Everytime you think of something that depends on what page you're looking at, think meta.

Since the whole navigation generation part is outsourced to templates, it's easy to customize it. You just need a mechanism to mark pages as hidden. Add a meta line to the files you want to "hide" (on top):

hidden: 1

and check for this meta information in your navigation template. First, you need the templates as files:

$ ./webapp.pl inflate

You can delete all templates and layouts except templates/navi.html.ep. Open it in your editor and you'll find something like this:

...
next if $c->name eq 'index';
...

which hides index pages from the navigation since they are already visible by clicking on the parent link. Add this line to skip HTML generation for content nodes with the meta hidden field set to a true value:

... 
next if $c->name eq 'index';
next if $c->meta->{hidden};
...

Done! :-)