Portlet links in new window
8
This code is used in an Educational Portal product but can be tweaked to fit your need.
This code adds a small icon next to the title of a 'portlet' that resides on the page. By clicking the portlet title, the portlet usually maximizes within the constraint of the portal template - but the extra icon allows for the portlet to be opened in it's own window.
This simulates an MDI interface.
(REQUIRES PopItUp snippet)
This code adds a small icon next to the title of a 'portlet' that resides on the page. By clicking the portlet title, the portlet usually maximizes within the constraint of the portal template - but the extra icon allows for the portlet to be opened in it's own window.
This simulates an MDI interface.
(REQUIRES PopItUp snippet)
function createUtilityLinks() {
if (!document.getElementsByTagName){ return; }
//Look only in the Portlet Grid for Links
var portletGrid = document.getElementById('PORTLETGRID');
var anchors = portletGrid.getElementsByTagName('a');
//alert(anchors.length)
// loop through all anchor tags
var intCount = anchors.length
var i=0
for (i=0;i<intCount;i++){
var anchor = anchors[i];
var link = String(anchor.getAttribute('href'));
var linkType = link.indexOf("?portlet")
var strLink = new String(anchor.getAttribute('href'));
if (linkType>-1 ){
strLink = strLink + "&style=utility"
anchor.parentNode.innerHTML = anchor.parentNode.innerHTML + " <a onClick=\" return popItUp('" + strLink + "','" + anchor.text +"');\" class='externalLink' title='Open this portlet in a floating window'> </a>"
i=i+1
}
}
}






There are currently no comments for this snippet.