Liferay 6-如何将自定义布局设置为默认设置? [英] Liferay 6 - How to set up custom layout as default?

查看:99
本文介绍了Liferay 6-如何将自定义布局设置为默认设置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在研究Liferay 6项目,该项目的一部分是创建一个新的布局模板,以作为默认值用于整个网站. Liferay自己的Wiki在有关布局模板的文档上非常稀疏,而且我对Google搜索甚至在SO上的运气都还不错.

I'm working on a Liferay 6 project, and part of the project is to create a new layout template to be used for the entire site as the default. Liferay's own wiki is very sparse on documentation about layout templates, and I haven't had better luck with Google searches or even here on SO.

我确实找到了一篇文章( Liferay-每个页面的布局)回答了这个问题,但似乎太过分了.在该问题中,目标是根据页面更改模板,因此答案是创建一个挂钩,并根据需要使用该挂钩即时设置模板.在这里,我只想一直将此定制模板作为 all 页面的默认模板,这就是为什么我认为其他问题的答案可能超出实际需要的原因.

I did find one article ( Liferay - Layout for each pages ) that sort of answers the question, but it seems like it might be overkill. In that question, the goal was to change the template based on the page, so the answer was to create a Hook and use that to set the template on the fly as needed. Here, I just want to have this custom template be the default for all pages, all the time, which is why I think the answer to that other question might be more than is really needed.

如果有人对此谜题有答案,请告诉我.谢谢!

If anyone has the answer to this puzzler, please let me know. Thanks!

-JLM-

推荐答案

好的,我已经弄清楚了我的困惑. Liferay有两种类型的布局模板-属于 theme (属于Liferay项目的一种)的模板,以及实际的布局模板项目本身.

OK, I've figured out my confusion. Liferay has two types of layout templates -- templates that are part of a theme, which is one type of Liferay project, as well as actual layout template projects themselves.

  • 您可以在主题中的模板上设置网站的整体页面布局.名为portal_normal.vm的主页模板是一个完整的网页,其中包含< html>标签,一个< head>和< body>等.主题中的其他模板通常是页面片段.
  • 另一方面,
  • 布局模板仅用于 ,用于在页面的主要内容区域(由主题模板文件中的标签定义)中布局portlet.它总是一个片段,并且只能具有< div>元素或< table>布置portlet.
  • The templates in a theme are where you set up the overall page layout for the site. The main page template, named portal_normal.vm, is a full web page with an <html> tag, a <head> and <body>, etc. Other templates in the theme are usually page fragments.
  • A Layout Template, on the other hand, is only for laying out the portlets in the main content region of your page (which is defined by tags in your Theme's template files). It is always a fragment and can only have <div> elements or a <table> for laying out the portlets.

幸运的是,这实际上使回答我的问题非常容易,至少在我需要的情况下.根据Liferay的文档,位于 http://www.liferay.com/community/wiki/-/wiki/Main/How+To+Change+Liferay+Default+Theme :

Fortunately, this actually makes answering my question very easy, at least in the context that I needed. Per Liferay's documentation at http://www.liferay.com/community/wiki/-/wiki/Main/How+To+Change+Liferay+Default+Theme :

注意:从6.x开始,您不能仅使用liferay-look-and-feel.xml中指定的主题ID.而是转到控制面板"->插件配置"->单击感兴趣的主题->记下插件ID并使用该ID [作为portal-ext.properties中的default.theme.id的值]

Note: As of 6.x, you cannot just use the theme id specified in the liferay-look-and-feel.xml. Instead, go to Control Panel->Plugins Configuration->Click on theme of interest->note the Plugin ID and use that [as the value for default.theme.id in portal-ext.properties]

我希望这可以帮助其他尝试解决这个问题的人!

I hope this helps some other people trying to figure this out!

这篇关于Liferay 6-如何将自定义布局设置为默认设置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆