Created
October 4, 2011 14:34
-
-
Save rotty3000/1261790 to your computer and use it in GitHub Desktop.
template to include the discussion widget in an article
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#set ($articleService = $portal.getClass().forName('com.liferay.portlet.journal.service.JournalArticleLocalServiceUtil')) | |
#set ($article = $articleService.getArticle($getterUtil.getLong($groupId), $reserved-article-id.data)) | |
$le-content.data | |
<div id="${request.portlet-namespace}discussion"> | |
<script type="text/javascript"> | |
AUI().use('liferay-portlet-url', 'aui-resize-iframe', function(A) { | |
var portletURL = Liferay.PortletURL.createRenderURL(); | |
portletURL.setPortletId('discussionwidget_WAR_discussionwidgetportlet'); | |
portletURL.setWindowState('pop_up'); | |
portletURL.setParameter('className', 'com.liferay.portlet.journal.model.JournalArticle'); | |
portletURL.setParameter('classPK', '${article.getResourcePrimKey()}'); | |
portletURL.setParameter('subject', '${htmlUtil.escape($reserved-article-title.data)}'); | |
var html = '<iframe frameborder="0" id="${request.portlet-namespace}discussion_frame" src="' + portletURL.toString() + '" scrolling="no" width="100%"></iframe>'; | |
A.one('#${request.portlet-namespace}discussion').append(html); | |
A.one('#${request.portlet-namespace}discussion_frame').plug(A.Plugin.ResizeIframe); | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment