Foros de discusión

Liferay 6.1.20 using different templates to render the same structure

thumbnail
Niall O'Grady, modificado hace 10 años.

Liferay 6.1.20 using different templates to render the same structure

New Member Mensajes: 11 Fecha de incorporación: 15/01/13 Mensajes recientes
Hello,

I have been battling with a requirement in recent days. I had hoped that it could be easily accomplished but I've not found a way to do what I need to do.

On our events site we have defined a structure to capture information relating to conference sessions. Start time, End Time, Title, Speaker .. all the usual attributes that a session at an event might include. We have defined a template to render this structured information and it is working well. I have a need to render the same content, in a different way. We want to build a 'My Agenda' page where attendees selections will appear in a list form. I had hoped that I might have been able to define a new template and have the session content displayed in two different ways on the site. It seems logical to me that this would be possible, separating content from display to allow for the re-use of content is always a good thing. With the association of a template being directly against a content item, I can't figure out a way to display the same content, on the same site, through two different templates.

I hope the above description explains my requirement. I also hope that I'm missing something obvious that would allow me to accomplish the requirement. Any thoughts or tips from the community would be most welcome.

Thanks in advance,
Niall O'Grady
thumbnail
Vilmos Papp, modificado hace 10 años.

RE: Liferay 6.1.20 using different templates to render the same structure (Respuesta)

Liferay Master Mensajes: 529 Fecha de incorporación: 21/10/10 Mensajes recientes
Hi Niall,

If you set the article in a Web Content Display portlet and save it, you should see some controls under the displayed article (basically the first template will be used for render the article).

You should see edit icon, template icon, cogwheel, and new icon. Press the cogwheel to configure it.

You should see the associated templates with radio buttons, so you can select which one to use.

I've tested it on 6.1.10, but I think it should work the same way on 6.1.20.

Cheers,
Vilmos
thumbnail
Niall O'Grady, modificado hace 10 años.

RE: Liferay 6.1.20 using different templates to render the same structure

New Member Mensajes: 11 Fecha de incorporación: 15/01/13 Mensajes recientes
Thanks very much for your prompt response Vilmos. I knew there had to be a way and you've pointed me to it.

#rookiemistake

Niall O'Grady
Bruno Carvalho, modificado hace 9 años.

RE: Liferay 6.1.20 using different templates to render the same structure

New Member Mensajes: 6 Fecha de incorporación: 1/08/14 Mensajes recientes
Is it possible to do the same in asset publisher?
thumbnail
Vilmos Papp, modificado hace 9 años.

RE: Liferay 6.1.20 using different templates to render the same structure

Liferay Master Mensajes: 529 Fecha de incorporación: 21/10/10 Mensajes recientes
I think, if you have the proper templates for the Web Content and Asset Publisher is set to use full content display then it should work. At least I think it will.