Page 1 of 1

Need navigation bar/menu/links

Posted: 18 Aug 2019, 01:01
by amphetamine
LINKS.png
LINKS.png (11.6 KiB) Viewed 4241 times
How to input links out there? buttons, navigation menu or any kinds of method to add quick links/bookmarks?

Re: Need navigation bar/menu/links

Posted: 18 Aug 2019, 09:08
by cas
this is managed within core/layout_api.php. The buttons are controlled with function layout_navbar_button_bar().
For as far as I know, there is no function to add links there so you would need to adjust that function to show more options.

Re: Need navigation bar/menu/links

Posted: 19 Aug 2019, 11:46
by amphetamine
is there any examples I can follow?

Re: Need navigation bar/menu/links

Posted: 19 Aug 2019, 12:16
by cas
This is really simple, here we go.
Open up layout_api.php (in the core directory)
Go to line 557 (this is with version 2.21)
You should be within the function called: function layout_navbar_button_bar()
just before this line :

Code: Select all

	if( $t_show_report_bug_button )  { 
insert the following code:

Code: Select all

		echo '<a class="btn btn-primary btn-sm" href="http://www.nuy.info"  target="_blank" >';
		echo '<i class="fa fa-edit"></i> ' . "Nuy.info";
		echo '</a>';
Save these changes and you will find another button, navigating to my site.
Clearly not the best option to change core programs. You could request if a default event can be placed there so it could be managed with a plugin. :mrgreen:

Re: Need navigation bar/menu/links

Posted: 19 Aug 2019, 13:02
by amphetamine
thank you so much!