Is there any way to have the old expandable navigations in a Boost-based theme?

Is there any way to have the old expandable navigations in a Boost-based theme?

by Diane Soini -
Number of replies: 6

I despise this nav drawer thing. It's too big, too long, too many clicks. I want the old expandable navigation back. I cannot figure out how to get it in there. It shows up somehow by magic in the Adaptable theme. But I want to have the old expandable navigation appear for Boost. It's not even possible to add most of the blocks anymore. How can I restore the old drill-down ajaxy navigation?

You may answer with programmatic/coding answers. For the life of me I cannot figure out how this appears the way I want it in older themes but not in Boost and I can't figure out how to backport it into Boost. If you know, that would be great. Otherwise, if there's a plugin I can download that will fix this, I'll take that as well.

Also if you can tell me why barely any of the blocks we have installed show up in the Add block list in Boost, that would be swell. We have moodle 3.5.

Average of ratings: -
In reply to Diane Soini

Re: Is there any way to have the old expandable navigations in a Boost-based theme?

by Jon Bolton -
Picture of Particularly helpful Moodlers Picture of Testers

This post is covering two things really Diane - the first issue is related to themes and you’ll probably get a better response in the Themes forum. The simple answer from someone who is not a theme developer is that different themes are coded to do different things and Boost is designed to be used without blocks in order to free up more screen space for users who want to focus on the site content (see https://moodle.com/news/boost-online-learning-fresh-new-user-experience-moodle-3-2/). If you are going to ask in the Themes forum though, please don’t create a duplicate post saying the same thing, just refer people back to this one.

The second issue is about why blocks don’t appear in the “Add Block” list. That functionality is not dependent on your theme, so if blocks aren’t appearing in that list, it’s likely to be related to one of two things:

  1. Blocks are designed to appear in certain contexts. Some blocks are coded to not allow multiple instances, or are restricted about where they can appear. So for example, you can add as many HTML blocks to a course page as you wish, but only one calendar block - that’s because it doesn’t make sense to have more than one calendar block in a course. And you can’t add a Flickr block anywhere other than a Tag page. So if you’re adding a block to a context that it’s not designed to be added to, it won’t appear in the list.
  2. If an installed block is hidden globally, it won’t appear in the “Add Block” list anywhere. See https://docs.moodle.org/35/en/Managing_blocks

In reply to Jon Bolton

Re: Is there any way to have the old expandable navigations in a Boost-based theme?

by Diane Soini -
I know about block contexts. The list of blocks differs for different themes on the same installation. Modifying some of their code to allow multiple or to change the regions they're allowed to appear seems to have no effect.
In reply to Diane Soini

Re: Re: Is there any way to have the old expandable navigations in a Boost-based theme?

by Jon Bolton -
Picture of Particularly helpful Moodlers Picture of Testers
In that case, it’s probably better asked in the Themes forum so I’m moving this there.
In reply to Diane Soini

Re: Is there any way to have the old expandable navigations in a Boost-based theme?

by Diane Soini -
Can I ask again?

I have gotten my theme to display most of the Site administration menu as a tree. But it is missing some items, and depending on what part of the site you are on, it is missing all of the items except the words "Site Administration".

How can I get the full Site Administration tree to display in every context and show all of the items, not just the root node or not most of the nodes (skipping some siblings of the root node.) Since I'm not able to add the settings block anymore (it's one of many blocks that refuse to show up in the Add block menu) I'm trying to just add it to the layout using a renderer and some templates. The renderer function does:

$node = $PAGE->settingsnav->find('siteadministration', navigation_node::TYPE_SITE_ADMIN);
if (!$node) {
$node = $PAGE->settingsnav->find('root', navigation_node::TYPE_SITE_ADMIN);
}
if ($node) {
$content .= parent::render_from_template('core/settings_link_tree', ['node' => $node]);
}
In reply to Diane Soini

Re: Re: Is there any way to have the old expandable navigations in a Boost-based theme?

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers
As far as I can tell when I've looked into this, the settingsnav attribute does not contain the full tree of the navigation for the page until an AJAX request from the client updates it, i.e. by a user expanding any given branch. You'll need to decode how the Navigation block works to see what I mean.
In reply to Diane Soini

Re: Re: Is there any way to have the old expandable navigations in a Boost-based theme?

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers
There is a theme in Moodle 3.7 that uses the Classic style of the page layouts we are familiar with including the Site Administration block, which I think is optional.The theme is called CLASSIC for these reasons.

Hope this helps
Mary
Edited: