简体   繁体   English

更改Liferay中的portal_normal.vm

[英]Changing portal_normal.vm in Liferay

Right now I am using the default portal_normal.vm to display my page. 现在我使用默认的portal_normal.vm来显示我的页面。 I have made some changes to custom.css to give some look to the theme (JUst changed the colour of the background) 我对custom.css进行了一些更改,以便对主题进行一些查看(JUst更改了背景的颜色)

I have made some changes to the portal_normal.vm. 我对portal_normal.vm做了一些更改。

What if I want to give a complete different look to my page ? 如果我想对页面给出完全不同的外观,该怎么办? My answer is make changes to the portal_normal.vm page. 我的答案是更改portal_normal.vm页面。

MY question is : 我的问题是:

portal_normal.vm has some variables and stuff like: portal_normal.vm有一些变量和类似的东西:

 <html class="$root_css_class" dir="#language ("lang.dir")" lang="$w3c_language_id">

I would like to know where does portal_normal.vm get these values from? 我想知道portal_normal.vm从哪里获取这些值? By values I mean values of variables like $root_css_class ? 通过值,我的意思是变量的值,如$ root_css_class? Usually velocity gets these values from a java class. 通常,velocity从java类中获取这些值。 So in liferay theme, from where does portal_normal.vm get these values from? 那么在liferay主题中,portal_normal.vm从哪里获取这些值? Is it ok to change the portal_normal.vm file completely? 可以完全更改portal_normal.vm文件吗?

Yes you can change any thing in portal_noraml.vm file and you design your own look. 是的,您可以更改portal_noraml.vm文件中的任何内容,并设计自己的外观。

Here to change portal_normal.vm we will use theme. 在这里更改portal_normal.vm我们将使用主题。 in _diff/templates place classic theme portal_normal.vm and do changes. 在_diff / templates中放置经典主题portal_normal.vm并进行更改。

All velocity variable are declared in init.vm file and we have another file called inti_custom.vm for declare our own velocity related variables. 所有速度变量都在init.vm文件中声明,我们有另一个名为inti_custom.vm的文件,用于声明我们自己的速度相关变量。

Most of the velocity variables which required for portal already defined by liferay people we just use those. 我们只是使用那些由liferay人员定义的门户所需的大多数速度变量。

Use init_custom.vm in _diff/templates folder for custom velocity varibles. 使用_diff / templates文件夹中的init_custom.vm来获取自定义速度变量。

https://github.com/liferay/liferay-portal/blob/6.2.x/portal-web/docroot/html/themes/_unstyled/templates/init.vm https://github.com/liferay/liferay-portal/blob/6.2.x/portal-web/docroot/html/themes/_unstyled/templates/init.vm

Most of the variables already loaded by velocity engine so max we dont need to create new variables in velocity engine. 大多数变量已经由速度引擎加载,因此我们不需要在速度引擎中创建新的变量。

You can create theme in liferay and provide customization in portal_normal.vm. 您可以在liferay中创建主题并在portal_normal.vm中提供自定义。

There is init.vm file where some of the variables are declared and also VelocityVariablesImpl.java is the class where vm variables are defined. 有init.vm文件,其中声明了一些变量,VelocityVariablesImpl.java也是定义vm变量的类。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM