Reputation: 27
I want to show only childs pages in all pages
$pages = \Ip\Menu\Helper::getChildItems();
echo ipSlot('menu', $pages);
Upvotes: 0
Views: 56
Reputation: 650
Child items work for a selected page. You should define a parent.
Here's a definition of this function:
public static function getChildItems($pageId = null, $depthLimit = 1000, $orderBy = null) { ... }
If you don't provide any parameters, current page is taken as a parent and all its children are returned. This means each page will show a different menu.
Therefore, provide a specific pageId
to this function to make menu the same on all pages.
P.S. if you have some specific case, define it. Maybe it can be solved with different tools.
Upvotes: 2