XF 2.2 Admin breadcrumbs and Collapsing sidebar menu?

mazzly

Well-known member
I'm writing an add-on that adds a new page under "Content" and I've run into some questions..

Question 1:
When I visit the Tags page, the Content sidebar stays open:
1704999855790.webp
But when I visit the "My new addon page" it closes..
1704999942043.webp
What am I doing wrong here? How to have it stay open?

Problem 2:
When visiting the Tags page, there are breadcrumbs added, the same goes to "child pages" of that one (without any template code for it)
1704999739666.webp
Where do these breadcrumbs come from? How can I add them for my own admin pages?
 
The admin navigation entries populate which section gets used, but you can manually set the section an action is linked to when viewing that action, but I can't remember the exact function call on the controller you need.
 
The admin navigation entries populate which section gets used
Yeah, I was kind of expecting that by having the admin navigation entry set to have "Parent navigation entry" set to "Content" it would automatically manage the menu staying open... I also closely mimicked the Tags navigation setup since that one was a similar "node" in the navigation

The only place I could find an admin controller setting anything related to breadcrumbs was in AddOn.php:
Code:
protected function postDispatchController($action, ParameterBag $params, AbstractReply &$reply)
{
$reply->setPageParam('breadcrumbPath', 'addOns');
}
Which ofc works when I try it (for breadcrumbs, not menu collapsing), but I would rather have the navigation/page setup correctly so that as much as possible automagically works, just like all the other admin pages seem to be doing it :D

Any Idea what I might be doing wrong @Kier @Paul B ?
 
Top Bottom