Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
Liferay Javascript - How to get global scope ID?
Hi,
I need to create a renderURL for an article stored in Global scope.
The following code will not work because the group ID is the site user logged in, not the global site.
How could I get the global scope ID from Liferay Javascript?
Thank you!
Gwowen
I need to create a renderURL for an article stored in Global scope.
The following code will not work because the group ID is the site user logged in, not the global site.
How could I get the global scope ID from Liferay Javascript?
var url = Liferay.PortletURL.createRenderURL();
url.setPortletId("56");
url.setWindowState('EXCLUSIVE');
url.setParameter("_56_groupId", themeDisplay.getScopeGroupIdOrLiveGroupId());
url.setParameter("_56_articleId", articleId); Thank you!
Gwowen
Found the answer.
var url = Liferay.PortletURL.createRenderURL();
url.setPortletId("56");
url.setWindowState('EXCLUSIVE');
url.setParameter("_56_groupId", themeDisplay.getCompanyGroupId());
url.setParameter("_56_articleId", articleId);