Foren

Multiple web content wrapper

JIna :), geändert vor 7 Jahren.

Multiple web content wrapper

New Member Beiträge: 22 Beitrittsdatum: 16.10.13 Neueste Beiträge
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
Milen Dyankov, geändert vor 7 Jahren.

RE: Multiple web content wrapper

Expert Beiträge: 310 Beitrittsdatum: 30.10.12 Neueste Beiträge
Can't you simply use AssetPublisher with own ADT to change the look and feel?
JIna :), geändert vor 7 Jahren.

RE: Multiple web content wrapper

New Member Beiträge: 22 Beitrittsdatum: 16.10.13 Neueste Beiträge
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
Andrew Jardine, geändert vor 7 Jahren.

RE: Multiple web content wrapper

Liferay Legend Beiträge: 2416 Beitrittsdatum: 22.12.10 Neueste Beiträge
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.