Is there a plugin for popups on Kirby Professional 2?

Hi there,

I’ve never used Kirby before but I have a client that is interested in adding a popup on their website, which is run on Kirby Professional 2. I don’t have access to the backend of the site yet, so it is all a little alien to me as I’m used to working with WordPress.

I can’t seem to find a plugin to create a popup for Kirby - is this correct? We don’t plan to add it to the homepage, just to a few incredibly niche blogs to encourage lead generation.

If anyone is able to advise on the best way forward then that would be great.

1 Like

I don’t think there is a plugin for this and you definitely don’t need a plugin to create a popup, after all, a popup is nothing else but a piece of Javascript that displays some content.

So you could include the HTML for the popup into the template, and then use some JavaScript to determine when it should pop up.

Or you might want to load something from the server via Ajax and then inject in a DOM element.

It really depends on your use case.

If the user should be able to place such a popup somewhere in the text, you probably want to create a custom kirbytag (a shortcode in WP speech) that users can insert and that are then converted into the HTML/JS/CSS you need.

I have a client for whom I would like to build a “pop up” but I am new to Kirby and would not know where to place the java script call so that it is in a good place.

I am grateful for any tips. Thx.

JavaScript is placed in the same place as you would put in a standard HTML template, i.e. either directly in the header/footer snippet or in a separate assets file that you load in the header/footer using the js() helper: js() | Kirby CMS