Hide static page in menu

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

Wed Jan 30, 2019 5:18 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

Wed Jan 30, 2019 7:28 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: 1920
Joined: Sun Aug 09, 2015 5:01 pm
Location: Zurich
Contact:

Wed Jan 30, 2019 10:05 pm

Yes, this should work.
Planet Bludit, Tipps, Snippets und nützliche Links. - Newsletter, Informationen zu Bludit (auf Deutsch).
mogh
Jr. Bludit
Posts: 1
Joined: Sun Jan 05, 2020 5:17 pm

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 ?
User avatar
Edi
Site Admin
Posts: 1920
Joined: Sun Aug 09, 2015 5:01 pm
Location: Zurich
Contact:

Sun Jan 05, 2020 5:45 pm

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?
Planet Bludit, Tipps, Snippets und nützliche Links. - Newsletter, Informationen zu Bludit (auf Deutsch).
gent
Jr. Bludit
Posts: 3
Joined: Thu Jan 09, 2020 9:31 pm

Thu Jan 09, 2020 10:09 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: 1920
Joined: Sun Aug 09, 2015 5:01 pm
Location: Zurich
Contact:

Thu Jan 09, 2020 11:40 pm

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
Planet Bludit, Tipps, Snippets und nützliche Links. - Newsletter, Informationen zu Bludit (auf Deutsch).
Post Reply