General developer forum

Help! Indentation for Boost Flat navigation.

 
Picture of Sandipa Mukherjee
Help! Indentation for Boost Flat navigation.
 

$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: -
Picture of Darko Miletić
Re: Help! Indentation for Boost Flat navigation.
Core developersParticularly helpful Moodlers

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

 
Average of ratings: -
Picture of Sandipa Mukherjee
Re: Help! Indentation for Boost Flat navigation.
 

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


 
Average of ratings: -
Picture of Darko Miletić
Re: Help! Indentation for Boost Flat navigation.
Core developersParticularly helpful Moodlers
No.



El jue., 4 oct. 2018 5:19 a. m., Sandipa Mukherjee (via Moodle.org) <
 
Average of ratings: -
Picture of Sandipa Mukherjee
Re: Help! Indentation for Boost Flat navigation.
 

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

 
Average of ratings: -
Picture of Darko Miletić
Re: Help! Indentation for Boost Flat navigation.
Core developersParticularly helpful Moodlers

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)
Picture of Alexander Bias
Re: Help! Indentation for Boost Flat navigation.
Core developersPlugin 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)
Picture of Sandipa Mukherjee
Re: Help! Indentation for Boost Flat navigation.
 

Thank you so much for your reply. 

 
Average of ratings: -
Picture of Altos Agency
Re: Help! Indentation for Boost Flat navigation.
 
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)