Just can’t seem to find the right answer, although it shouldn’t be difficult.
I want to exclude a page from the usual main menu, how can I exclude a page, without making the page invisible. I want to use a loose call-to-action button with a link to that page, that’s what I already managed to do.
I think something like
$pages->not(page('pagetoexclude')) could work.
@distantnative, this works!
For others, first the menu started with this regular part
<?php foreach($pages->visible() as $p): ?>
I’ve changed it to this
<?php foreach($pages->visible()->not(page('aanmelden')) as $p): ?>
and now it excludes the “aanmelden” page
January 7, 2016, 4:18pm
I try to exclude several pages at once, like this:
<?php foreach($pages->visible()->not(page('about', 'contact')) as $p): ?>
This only excludes the first item. Am I doing something wrong?
(Reason for doing this: I want to use a custom menu that only contains these items at another place.)
page helper only takes one argument and returns a single page. The following should work:
<?php foreach($pages->visible()->not('about', 'contact') as $p): ?>
January 7, 2016, 4:25pm
Purrrrfect! Thanks a lot.