Skip to content

Instantly share code, notes, and snippets.

@evaldeslacasa
Created March 15, 2017 17:57
Show Gist options
  • Save evaldeslacasa/d4e5d7da79ff6195b7305c24936a2b5e to your computer and use it in GitHub Desktop.
Save evaldeslacasa/d4e5d7da79ff6195b7305c24936a2b5e to your computer and use it in GitHub Desktop.
Liferay pop ups javascript
function popUpUrl(id) {
var url = Liferay.PortletURL.createRenderURL();
url.setPortletId("56"); // "Web Content Display" portlet ID
url.setWindowState('pop_up');
url.setPortletMode('view');
url.setParameter("groupId", Liferay.ThemeDisplay.getScopeGroupIdOrLiveGroupId());
url.setParameter("articleId", id); // webcontent ID
return url;
};
/*AUI().ready('aui-dialog', 'aui-dialog-iframe', 'liferay-portlet-url', function(A) {
url = popUpUrl("POPUP_SUBSCRIPTION");
console.log(url.toString());
Liferay.Util.openWindow({
dialog: {destroyOnHide: true},
cssClass: 'aoc-pub-lightbox',
align: Liferay.Util.Window.ALIGN_CENTER,
toolbars: false,
resizable: true,
modal: true,
uri: url.toString()});
});*/
YUI().use(
'aui-modal',
function(Y) {
var modal = new Y.Modal(
{
headerContent: 'Hello',
centered: true,
render: '#modal'
}
).render();
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment