This topic is locked

From Main menu open add page in popup

9/26/2024 7:32:45 PM
PHPRunner General questions
A
asawyer13 authorDevClub member

I have an option on the menu. I want to open the add page as a popup when the user clicks on the menu item rather than opening the list page.

Alan

M
MikeUk 9/27/2024

I think you should be able to modify the menu; link to options: and select add from the drp[down.

Then in your pages section, at the top for the list, click the settings and select the option to open the add page as a popup.
Not sure if it will work like this, but that's what I'd try.

Sergey Kornilov 9/30/2024
  1. Create a new menu item with settings similar to what you can see on my screenshot. URL needs to point to your list page in question.

img alt

  1. Add the following code to that List page Javascript OnLoad event. Also adjust it accordingly.

const queryString = window.location.search;
const urlParams = new URLSearchParams(queryString);
const action = urlParams.get('a');

if (action=='addnew') {
Runner.displayPopup({url:'categories_add.php'});
}