Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

Can you open a html widget link into a new window in a certain size, on the service portal?

dave_edgar
Mega Guru

Now we've tried lots of things already but all we seem to be able to do is get the link to open into a new tab.

We have this on our CMS portal which open a link to a chat window:
a href="$chat_support.do?queueID=${menuO.sys_id}" onclick="window.open('$chat_support.do?queueID=${menuO.sys_id}','chat','width=800,height=600'); return false;">${menuO.name}</a>

But when trying this on the portal via a html widget the onclick section gets striped out.  

We've looked at the SN portal training but this isn't covered and I can't find good example of how to do it in the community.

Below is the closest I have gotten to getting there :
adding this to the JSON section 
"target": {"value": "_blank",
"displayValue":"_blank"
}
 
BUT anyone know if you can define the window size by adding a line such as: 
"target":{
"value": "_blank",
"displayValue":"_blank"
"height":"600",
"width":"800"}

1 ACCEPTED SOLUTION

Kumar Tella
Mega Expert

Dave,

The popup window and reszing working now. I Modified the Circle Icon code in HTML Template and added client script. Changes are here.

<!--// Circle Icon popUp-->
<a ng-click="c.openPopUp()" class="circle_icon {{::options.class_name}} text-{{::options.color}}" >
<span class="image-container" ng-if="options.u_image">
<img class="media-object" src="{{::options.u_image}}" width="55" height="55" alt="${{{options.title}}}" style="cursor:pointer;">
</span>
<h2 style="cursor:pointer;">{{::options.title}}</h2>
<span class="text-muted" style="cursor:pointer;">{{::options.short_description}}</span>
</a>

Added this in client script in Client controller:

// Client script
function() {
var c = this;
c.openPopUp = function() {
var url = "my url";
var popup = window.open (url, "popup", "width=900, height=600");
}
}

View solution in original post

7 REPLIES 7

Kumar Tella
Mega Expert

Hi Dave,

I am also looking for the similar thing. I would like to open a popup window instead of new window/tab. Did you find a solution for this? if so can you share?

Thanks

Kumar

Hi

 

We've kinda found a way of doing it but I still don't like it tbh.  On SNGuru they have some modal widgets that kinda get what you want but you miss stuff like the window auto closing after submitting or a message to confirm submission.  I guess it depends what you are after but I certainly haven't found a simply onclick open new window 800x600 size for instance. 

 

😞 

Kumar Tella
Mega Expert

Thanks Dave. I will look at this and let you know if I find a solution.

jeffyt1
Mega Contributor

<a href="yourpage.htm" target="_blank" onClick="window.open('yourpage.htm','pagename','resizable,height=600,width=800'); return false;">New Page</a>