How to load any link on Service Portal modal

JC S_
Mega Guru

We have a business requirement to open a links on a modal instead of a page. So basically we have this page X which will contain HTML widget and we add links to that HTML widget.

Now the out of the box behavior when you click a link is that it will either load the link on current page or open a new window. What we need to achieve is when you click the link, it will open a modal and it will open that link inside the modal.

One use-case we have is for surveys for example. Instead of loading surveys on a separate page, we want to load it on a modal instead.

3 REPLIES 3

nathanfirth
Tera Guru
I wrote a blog post about opening modals a while ago: https://serviceportal.io/modal-windows-service-portal/ Hope that helps!

Hi Nathan,

That's one of the resources I actually looked into. I already implemented it on other widgets before. However on this specific use case, we want to utilize the modals on links clicked on the HTML widget.

GOAL

  1. Add HTML widget on page designer then edit contents of that HTML widget
  2. End user clicks a link we added on the HTML widget then a modal opens up and loads the link the user clicked.

I am thinking along the lines of showing an iframe inside the modal and passing the link clicked to that iframe but not sure if that's the best way to achieve our end goal of showing links clicked inside a modal. We are looking into linking to other Service Portal pages (like showing a catalog item form or survey instead of loading it on another page and external websites if ever. Any ideas on how we should approach this?

JC S_
Mega Guru

Any idea on how to implement this?