简体   繁体   中英

Changing portal_normal.vm in Liferay

Right now I am using the default portal_normal.vm to display my page. I have made some changes to custom.css to give some look to the theme (JUst changed the colour of the background)

I have made some changes to the 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.

MY question is :

portal_normal.vm has some variables and stuff like:

 <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? By values I mean values of variables like $root_css_class ? Usually velocity gets these values from a java class. So in liferay theme, from where does portal_normal.vm get these values from? Is it ok to change the portal_normal.vm file completely?

Yes you can change any thing in portal_noraml.vm file and you design your own look.

Here to change portal_normal.vm we will use theme. in _diff/templates place classic theme portal_normal.vm and do changes.

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.

Most of the velocity variables which required for portal already defined by liferay people we just use those.

Use init_custom.vm in _diff/templates folder for custom velocity varibles.

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.

There is init.vm file where some of the variables are declared and also VelocityVariablesImpl.java is the class where vm variables are defined.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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