Help! Indentation for Boost Flat navigation.

Help! Indentation for Boost Flat navigation.

by Sandipa Mukherjee -
Number of replies: 8
Picture of Particularly helpful Moodlers

$nodemain = $navigation->add("parent");

$nodeshop = $navigation->add("child1", new moodle_url("..."), navigation_node::TYPE_CUSTOM,

            null, null);

$nodecart = $navigation->add(child2,  new moodle_url("..."), navigation_node::TYPE_CUSTOM,

            null, null);

$nodemain->showinflatnavigation = $nodeshop->showinflatnavigation = $nodecart->showinflatnavigation = true;


I want a flat nav like 

parent

- child1

- child2


But by this code I have achieved 

parent

child1

child2

under boost left side flat nav. I hope this is the right forum for asking help regarding this. 

Thanks and regards,

Sandipa



Average of ratings: -
In reply to Sandipa Mukherjee

Re: Help! Indentation for Boost Flat navigation.

by Darko Miletić -

Flat navigation is called flat for a reason. There is no indenting.

In reply to Darko Miletić

Re: Help! Indentation for Boost Flat navigation.

by Sandipa Mukherjee -
Picture of Particularly helpful Moodlers

Hello Darko,

Thanks for your reply. I can understand the meaning of flat nav but I am curious to know how can my course shows in a parent-child manner. PFA attachment. 

Thanks and regards,

Sandipa

Attachment flatnav.jpg
In reply to Sandipa Mukherjee

Re: Help! Indentation for Boost Flat navigation.

by Darko Miletić -
No.



El jue., 4 oct. 2018 5:19 a. m., Sandipa Mukherjee (via Moodle.org) <
In reply to Darko Miletić

Re: Help! Indentation for Boost Flat navigation.

by Sandipa Mukherjee -
Picture of Particularly helpful Moodlers

I can not understand your reply. Can you help me to find out how "my course" makes the indentation manner in boost flat navigation?

In reply to Sandipa Mukherjee

Re: Help! Indentation for Boost Flat navigation.

by Darko Miletić -

All elements in the flat navigation have indent 0 (no indent) except children elements of course nodes. This is hard-coded in the boost theme implementation.

Start looking at how $PAGE->flatnav is initialized

https://github.com/moodle/moodle/blob/81bbf426f6fde2ad6bc4736fb8f3e719ec9179ce/lib/pagelib.php#L768

In essence - it is not possible to accomplish what you want with the way boost theme is implemented. If you really need it you should create your own theme based on boost and do the changes there.


Average of ratings: Useful (2)
In reply to Darko Miletić

Re: Help! Indentation for Boost Flat navigation.

by Alexander Bias -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Hi Sandipa,

while I agree with Darko that Moodle core has a flat navigation structure with the exception of the MyCourses list, I would like to suggest that you have a look at https://moodle.org/plugins/local_boostnavigation where we have built some hacks to support child nodes in the Boost nav drawer.

Cheers,
Alex

Average of ratings: Useful (1)
In reply to Sandipa Mukherjee

Re: Help! Indentation for Boost Flat navigation.

by Altos Agency -
https://moodle.org/plugins/local_boostnavigation

have you looked into Boost navigation fumbling?


"Custom nodes can be nested with one hierarchy level, i.e. a custom node can have children nodes. The create a child node instead of a parent node, just prefix the custom node title with a hyphen.
For example:
Administration|/admin/index.php
-List of Moodle users|/admin/user.php
-Manage courses|/course/management.php "



looks like this:


Average of ratings: Useful (2)