Unlisted static page in menu

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

Sat May 11, 2019 2:06 pm

Hello,
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>
</li>
<?php endforeach ?>
The idea is to create a subpage that is not visible in the menu.

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

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