掲示板

Layout Templates in Liferay 7

7年前 に Stephen Hardesty によって更新されました。

Layout Templates in Liferay 7

New Member 投稿: 14 参加年月日: 16/05/31 最新の投稿
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
7年前 に Olaf Kock によって更新されました。

RE: Layout Templates in Liferay 7

Liferay Legend 投稿: 6396 参加年月日: 08/09/23 最新の投稿
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.
7年前 に Stephen Hardesty によって更新されました。

RE: Layout Templates in Liferay 7

New Member 投稿: 14 参加年月日: 16/05/31 最新の投稿
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.
7年前 に Stephen Hardesty によって更新されました。

RE: Layout Templates in Liferay 7

New Member 投稿: 14 参加年月日: 16/05/31 最新の投稿
Also, is the methodology the same for a new nested portlet template or are there other/additional steps?
thumbnail
7年前 に Todd Waits によって更新されました。

RE: Layout Templates in Liferay 7

New Member 投稿: 7 参加年月日: 16/06/22 最新の投稿
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
7年前 に Travis Cory によって更新されました。

RE: Layout Templates in Liferay 7

Junior Member 投稿: 73 参加年月日: 13/06/04 最新の投稿
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
7年前 に Todd Waits によって更新されました。

RE: Layout Templates in Liferay 7

New Member 投稿: 7 参加年月日: 16/06/22 最新の投稿
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
7年前 に Olaf Kock によって更新されました。

RE: Layout Templates in Liferay 7

Liferay Legend 投稿: 6396 参加年月日: 08/09/23 最新の投稿
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
7年前 に James Hinkey によって更新されました。

RE: Layout Templates in Liferay 7

Junior Member 投稿: 62 参加年月日: 11/02/15 最新の投稿
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