Same web content showing with different display template.

For Advance Web content management, Liferay provides the features of structures and templates. Structures are used for creating the data entry form for the content creators and Templates are responsible for look and feel of a web content on web page.

Suppose, if we want, a single piece of web content( article id is 'weContentArticleId')  to display with two different display template( template id is 'displayTemplateId1' and 'displayTemplateId1') for different look and feel. 

We can do it, by using the liferay OOTB Web Content Display Portlet. In the configuration mode, it provides the option for overriding the default display tempalte associated with the web content.

We can also do the same thing through the tag library as well.

e.g.

<liferay-ui:journal-article articleId="webContentArtilceId" groupId="<%= themeDisplay.getScopeGroupId() %>" templateId="displayTemplateId1" />

<liferay-ui:journal-article articleId="webContentArtilceId" groupId="<%= themeDisplay.getScopeGroupId() %>" templateId="displayTemplateId2" />

6
Blogs
Hi Sushil!
Are you sure that on Web Content Display isn't possible choose a different presentation template?
Which is the "Liferay web content display" that you nominate in your article?

Thanks in advance, JF
Hi Jader,

Liferay Web Content Display Portlet does provide the option for choosing the differnt display template while creating the web content. But It doesn't provides the option for associating the different display template with same piece of the web content.

Suppose, I have created a web content and want to display the same web content at two different places with different look and feel. Can't do it using the Web content display template.

Thanks
Sushil Saini
Hi Sushil!
I've tryed and "works for me"! emoticon
The Web Content Display portlet, when in configuration I choose a content, after pressing the "save" button the panel is reloaded and the template's list is showed.
Here I can choose a different template -aka template of a structure; it is correct?-.

And I'm into the configuration panel of Web Content Display portlet.

I'm wrong? Am I looking for another functionality?

Thanks in advance! emoticon)
Hi Jader,

Whatever you have mentioned above is correct. But go little further and add one more web content display portlet on the same page. and select same web content in second portlet. And try to associate the different display template in second portlet for showing the same content with different look and feel.
You will notice the display template will get updated to first portlet as well.

Basically, you cannot associate two different display template with same piece of web content.

Thanks
No: the web content display portlet is instanceable.
This means that for each instance of the portlet you have a unique id (portlet namespace).

When you use the configuration panel, you are setting the portlet's preferences and these are binded on the portlet id. So it's possible to have in the same page three web content display page that are configured to show the same web content with different rendering template.

Look at this page:

http://www.puro.it/it/store/accessori-telefonia/cover/apple/iphone-5/03-ultra-slim

here are placed two web content display portlet configured to show the same web content with different template (look the source for "Descrizione" and "Specifiche Tecniche").
Thanks Jader, ... Thank you very much for following up with me and correcting me.

I know the web content display portlet is instance-able. But for changing the display template. I was trying to edit the content and change the display template. By that way it was modifying the default template associated with web content and content display get change at all the places.

But I haven't noticed the option of overriding the default display template through configuration panel.

Thanks again. I have corrected my post to reflect the same.