Hide static page in menu

Post Reply
xanmean
Jr. Bludit
Posts: 5
Joined: Tue Jan 29, 2019 7:14 pm

I create static page 404, how i can hide it in menu. Thank you.

Code: Select all

<?php foreach ($staticContent as $staticPage): ?>
	<li>
	<a href="<?php echo $staticPage->permalink() ?>"><?php echo $staticPage->title() ?></a>
	</li>
<?php endforeach ?>
xanmean
Jr. Bludit
Posts: 5
Joined: Tue Jan 29, 2019 7:14 pm

I don't know php but i do this

Code: Select all

<?php foreach ($staticContent as $staticPage): ?>
<?php if($staticPage->slug() != '404'){ ?>
<li>
<a href="<?php echo $staticPage->permalink() ?>"><?php echo $staticPage->title() ?></a>
<?php } ?>
</li><?php endforeach ?>
User avatar
Edi
Site Admin
Posts: 3120
Joined: Sun Aug 09, 2015 5:01 pm
Location: Zurich
Has thanked: 54 times
Been thanked: 77 times
Contact:

Yes, this should work.
Clickwork - Websites mit Bludit | Planet Bludit - Tipps und Snippets
mogh
Jr. Bludit
Posts: 1
Joined: Sun Jan 05, 2020 5:17 pm

Where do I have to put this code snippet ?
Into one of the many PHP files of the page or into a field on the admin page ?
User avatar
Edi
Site Admin
Posts: 3120
Joined: Sun Aug 09, 2015 5:01 pm
Location: Zurich
Has thanked: 54 times
Been thanked: 77 times
Contact:

mogh wrote: Sun Jan 05, 2020 5:21 pm Where do I have to put this code snippet ?
Into one of the many PHP files of the page or into a field on the admin page ?
It depends from the theme. Which theme do you use?
Clickwork - Websites mit Bludit | Planet Bludit - Tipps und Snippets
gent
Jr. Bludit
Posts: 3
Joined: Thu Jan 09, 2020 9:31 pm

I have the same problem and hope that there will be an option on the "Advanced"-tab to hide a static-page from the menu.
User avatar
Edi
Site Admin
Posts: 3120
Joined: Sun Aug 09, 2015 5:01 pm
Location: Zurich
Has thanked: 54 times
Been thanked: 77 times
Contact:

At the moment this has to be done manually or with a code snippet.

But you can post a feature request at GitHub:

https://github.com/bludit/bludit/issues
Clickwork - Websites mit Bludit | Planet Bludit - Tipps und Snippets
Post Reply