This topic is locked

Extending a user account menu

1/31/2025 12:21:26 PM
PHPRunner Tips and Tricks
Sergey Kornilov admin

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.

img alt

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.

  1. 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>
');

});
  1. 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;
});
});