掲示板

Multiple web content wrapper

7年前 に JIna :) によって更新されました。

Multiple web content wrapper

New Member 投稿: 22 参加年月日: 13/10/16 最新の投稿
Hi,
One of the components I need to have in my portal is possibility to group several web contents under collapsible accordion panel with specific configurable title. In addition it would be good if each web content would render according its template and I won't need to write the same rendering logic twice. Using 6.2 CE version.
Any ideas how to achieve that?
Thanks in advance.
thumbnail
7年前 に Milen Dyankov によって更新されました。

RE: Multiple web content wrapper

Expert 投稿: 310 参加年月日: 12/10/30 最新の投稿
Can't you simply use AssetPublisher with own ADT to change the look and feel?
7年前 に JIna :) によって更新されました。

RE: Multiple web content wrapper

New Member 投稿: 22 参加年月日: 13/10/16 最新の投稿
AssetPublisher with ADT was my first option, but I was not able to figure out two things:
- how to define configurable title for asset publisher and get it in ADT
- how to render web content according its template

Milen Dyankov, may be you could provide guidelines regarding the questions above?
thumbnail
7年前 に Andrew Jardine によって更新されました。

RE: Multiple web content wrapper

Liferay Legend 投稿: 2416 参加年月日: 10/12/22 最新の投稿
Hi Jina,

For the custom title you could hook the ADT configuration.jsp and add a custom field to it, or you could possibly use a cheat and use the portlet-title that you can set in the "Look and Feel" section of the portlet configuration -- assuming that you are hiding the portlet borders.

For your second part, you could use the service locator to load the JournalArticleService and the DDMTemplateService and then use a method on the JournalArticleService that allows you to pass the article ID (which you can get from the Asset in the loop) and the template key (for the template you want to use in the rendering process) to produce the html that you want to output for each item --

JournalArticleLocalServiceUtil.getArticleContent(article, ddmTemplate.getTemplateKey(), null, themeDisplay.getLanguageId(), themeDisplay);


I use this method quite often so that I can have summary templates for my web content that I can use with this method and leave the "detail" template as the default on the web content item so that when you click through to the display page, the full version is shown using the default stuff.