Forums de discussion

Layout Templates in Liferay 7

Stephen Hardesty, modifié il y a 7 années.

Layout Templates in Liferay 7

New Member Publications: 14 Date d'inscription: 31/05/16 Publications récentes
I am trying to build a new layout template in Liferay 7. I have never used a previous version of Liferay, just jumping in with 7. I am using the Liferay IDE
and have repeatedly gone over the directions here - https://dev.liferay.com/develop/tutorials/-/knowledge_base/7-0/layout-templates . I am confused because the portlets, theming, and other work I've done so far seem to NOT use the "plugins SDK". Everything is done with gradle. It seems that much of the documentation out there says that the plugins SDK is a relic of pre-7 liferay iterations. The directions at dev.liferay.com seem to be bleeding together methodologies for 6 and 7.

My question is - do you need the plubins SDK to create a layout template in Liferay 7, and if not, how do you create a new layout template in Liferay 7?
thumbnail
Olaf Kock, modifié il y a 7 années.

RE: Layout Templates in Liferay 7

Liferay Legend Publications: 6403 Date d'inscription: 23/09/08 Publications récentes
Stephen Hardesty:
My question is - do you need the plugins SDK to create a layout template in Liferay 7, and if not, how do you create a new layout template in Liferay 7?


You're absolutely right: In Liferay 7 you don't need the SDK - up to 6.2 it was the recommended environment. And if you didn't give the link yourself: That's what I would have pointed you to to create a layout template. A layout template is basically nothing but the grid structure of a page. All the surroundings and style come from a theme, all of the content comes from portlets. The documentation that you link contains such an example.

If you have problems with this documentation, I'd be interested which of the passages are unclear to you, rather than rephrasing it here in different words. The documentation is far more verbose than I'd plan to be in a forum post - but if you have a specific question or point where you get stuck, that's what we can try to fix here.

And finally: Don't worry. In the end, Layout Templates are one of the most trivial things one can build in Liferay. I've been joking about myself that the former ca 60*60 pixel icon in ancient versions took me longer to build than the actual layout template. It probably only takes a single layout template to be built to see the simplicity - and I can understand that this might get stuck somewhere, if only for being used to other environments that use the same vocabulary for different purposes.
Stephen Hardesty, modifié il y a 7 années.

RE: Layout Templates in Liferay 7

New Member Publications: 14 Date d'inscription: 31/05/16 Publications récentes
So without using the SDK, I can simply make a .tpl file and place it in my theme's root folder, or does it go somewhere else? That is my biggest point of confusion. Where does the .tpl file go for your new layout template and is that all that is necessary to make one.
Stephen Hardesty, modifié il y a 7 années.

RE: Layout Templates in Liferay 7

New Member Publications: 14 Date d'inscription: 31/05/16 Publications récentes
Also, is the methodology the same for a new nested portlet template or are there other/additional steps?
thumbnail
Todd Waits, modifié il y a 7 années.

RE: Layout Templates in Liferay 7

New Member Publications: 7 Date d'inscription: 22/06/16 Publications récentes
Olaf,

The confusion I have about the documentation provided is not the example of a layout template, but the layout project creation, and deployment of the layout project.

The tutorial states:

This tutorial assumes you’ve already created your layout template project. For example, execute ./create.sh hello-world "Hello World" from the layouttpl folder of the Plugins SDK.


(emphasis added by me)

This leads me to believe that layout templates are still tied to Ant/Ivy and the Liferay SDK. Is there another method to create a layout template in Liferay 7 like the new Theme process using Node and Gulp?
thumbnail
Travis Cory, modifié il y a 7 années.

RE: Layout Templates in Liferay 7

Junior Member Publications: 73 Date d'inscription: 04/06/13 Publications récentes
Hey Todd,

As part of the Yeoman generator for themes, there is a generator for layouts as well. Please see the documentation for the generator here to create a layout using the generator.
thumbnail
Todd Waits, modifié il y a 7 années.

RE: Layout Templates in Liferay 7

New Member Publications: 7 Date d'inscription: 22/06/16 Publications récentes
Travis Cory:

As part of the Yeoman generator for themes, there is a generator for layouts as well.


We totally missed that. The `yo` workflow was extremely easy.

Thanks for the help.
thumbnail
Olaf Kock, modifié il y a 7 années.

RE: Layout Templates in Liferay 7

Liferay Legend Publications: 6403 Date d'inscription: 23/09/08 Publications récentes
Todd Waits:
We totally missed that. The `yo` workflow was extremely easy.


...and I totally missed the project creation documentation on the link. I've filed an improvement suggestion, so that this chapter gets on the list for "requiring an update"
thumbnail
James Hinkey, modifié il y a 7 années.

RE: Layout Templates in Liferay 7

Junior Member Publications: 62 Date d'inscription: 15/02/11 Publications récentes
Hi guys,

Liferay 7 supports Layout Template development using the Themes Generator and Plugins SDK. Initially when documentation was first being produced for 7.0, it was only available via the Plugins SDK--hence, the Plugins SDK-based tutorial "Layout Templates". But I can see why folks are finding the SDK-based one first and not seeing the Yo-based one.

So, we're taking care of that to promote the Yo-based (themes generator-based) one. Ticket https://issues.liferay.com/browse/LRDOCS-2929

Thanks for the head's up via the article's Do you have any suggestions? feedback feature. :-)

Jim