How to create a pop up on load of a portal page (not catalog item)

j3ssicav
Kilo Expert

Can you load a modal popup onload of a portal page? Every solution I have read for completing this either includes an onclick function initiating the modal, or using a catalog client script. 

I just want it to pop up when they reach a specific page (asking them to answer a couple of questions, but they can opt out).  

1 ACCEPTED SOLUTION

You can definitely use this. For this , you have to create a custom widget and open this widget in Modal window using widget option in spModal function. You can use something like below.

spModal.open({
size: 'lg',
widget: widgetId,
buttons: [{label:'${Close}', cancel: true}],
widgetInput: {sys_id: articleID}
});
 

View solution in original post

4 REPLIES 4

rajneeshbaranwa
Giga Guru

That should be easy.

 

1- Create a new Widget

2- In client controller of the widget provide spmodal script. 

3- Add this widget to the page.

4- Now, each time user navigate to this page, Pop-up will appear to them.

 

Please amrk my answer correct/helpful , If it helped.

 

I added below 

function(spModal) {
  /* widget controller */
  var c = this;
	spModal.alert('How do you feel today?').then(function (answer) {
            c.simple = answer;
        });
}

Do you think you could use spModal to make an entire form with a few questions? As soon as the form is submitted, it also needs to produce a feedback record with the results. I don't think GR is to be used in the client script, right?

You can definitely use this. For this , you have to create a custom widget and open this widget in Modal window using widget option in spModal function. You can use something like below.

spModal.open({
size: 'lg',
widget: widgetId,
buttons: [{label:'${Close}', cancel: true}],
widgetInput: {sys_id: articleID}
});
 

Jaspal Singh
Mega Patron
Mega Patron

Hi,

 

All you need is to

1. Create a new widget : Pop-up on Portal

2. Follow link & add the HTML part ot Body HTML & script part in Client Controller.

3. Update the portal homepage by using the widget you defined in step 1.