Unlisted static page in menu

Post Reply
Jr. Bludit
Posts: 3
Joined: Sun May 05, 2019 2:49 pm

Sat May 11, 2019 2:06 pm

how to make a page or a subpage unlisted in menu ?
I have something like that in my topbar.php :

Code: Select all

<!-- Static pages -->
<?php foreach ($staticContent as $staticPage): ?>
<li class="nav-item <?php echo (($url->slug()==$staticPage->slug())?'active':'') ?>">
<a class="nav-link" href="<?php echo $staticPage->permalink(); ?>"><?php echo $staticPage->title(); ?></a>
<?php endforeach ?>
The idea is to create a subpage that is not visible in the menu.

User avatar
Site Admin
Posts: 1471
Joined: Sun Aug 09, 2015 5:01 pm
Location: Zurich

Mon May 13, 2019 11:04 am

You can add an if condition with the slug of the page.
Planet Bludit, Tipps, Snippets und nützliche Links. - Newsletter, Informationen zu Bludit (auf Deutsch).
Post Reply