This is a purely Javascript code which means it will work in both PHPRunner and ASPRunner.NET apps. We want to add a new menu item to the user account dropdown in the top right corner of the application.
We will offer two versions of the code here. In both cases the code needs to be added to Event Editor -> custom_functions.js section.
- Add a hyperlink pointing to a specific page like help.php:
$( document ).ready(function() {
$("ul.dropdown-menu").append('
* <a href="help.php" id="onlineHelp"><span>Online help</span></a>
');
});
- Add a hyperlink and assing Javascript code handler to click event. In this example we will show how to open a page in a popup.
$( document ).ready(function() {
$("ul.dropdown-menu").append('
* <a href="#" id="onlineHelp"><span>Online help</span></a>
');
$( "a[id='onlineHelp']" ).bind( "click", function() {
Runner.displayPopup( {
url: 'products_view.php?editid1=2'
});
return false;
});
});