Hi,
I am using Moodle version 3.3.2.
I am trying to use a javascript code on one of the menu items in the header. This menu is created from "custom menu items" in SIte administration->Apperance->Themes->Theme settings.
I want to insert a javascript function to that one of the menu items. In general, we just link a site URL to menu items like "Contact Us|URL here", but I want to insert a trigger of javascript to that "Contact Us" button, something like below. We can't do that in "Theme settings"
Eg: <a href="javascript:FreshWidget.show();">Your link</a>
I am trying to link the freshdesk popup window to this menu item(button).
Finally, I got another way, instead of linking the script to that button, there is another way like create a button from within Moodle core files. Like kind of HTML code to create a link and a button.
So I added the below code to "header.php" in theme->layout->include->header.php file. That worked out really well. But the problem is the button created at the end of the header, beside the search button(menu1.png).
<li><a title="Contact Us" href="javascript:FreshWidget.show();">Contact Me</a></li>
<li><?php echo $OUTPUT->page_heading_menu(); ?></li>
Is there any way to link the above script to a submenu, please see the attachment(menu.png).