How do I hide a page for a menu? #702
-
How do I hide the homepage from the menu? I thought using visible: false would work, but it's still showing up. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
You can easily filter pages by adding a custom page property. The property name you use can be anything, I tend to use For example to hide pages from your menus you can add a 1. Add the custom page property to your configIn return array(
'page' => [
'visible' => true,
],
); This defines a custom page property called 2. Filter your pages collection for your menu<? $items = collection('pages', ['folder' => $folder ?? '.', 'level' => $level ?? null, 'recurse' => 'true', 'filter' => ['visible' => 'true']]) ?> Filters your pages using the 3. Exclude pages from your menuYou can now easily hide a page from your menu by adding: Title: Foo
visible: false Thats it! Happy coding. |
Beta Was this translation helpful? Give feedback.
You can easily filter pages by adding a custom page property. The property name you use can be anything, I tend to use
visible
for this.For example to hide pages from your menus you can add a
visible
property. These are the steps required to set this up:1. Add the custom page property to your config
In
/joomlatools-pages/config.php
addThis defines a custom page property called
visible
that will be added to each page and set totrue
by default.2. Filter your pages collection for your menu