Fórumok

Template modifications for Custom Themes

thumbnail
G Joseph, módosítva 15 év-val korábban

Template modifications for Custom Themes

Junior Member Bejegyzések: 47 Csatlakozás dátuma: 2008.04.03. Legújabb bejegyzések
Hi All,
I was able to create a new theme and redeploy it after some simple modifications for test purpose. Now I want to make some serious changes. I'm getting a bit confused in understanding the velocity templates. Basically what I want to know is the input source to these templates. Where can we find the necessary Java files, or some other files, which does the logic to provide data to these templates.

For example, I'm looking for information like:
In portal_normal.vm there is a 'if' block which checks the 'has_Navigation' and parse the navigation template. Where does the boolean gets set? From where does the navigation template gets data for processing?

I'm looking for such information. How can we relate these templates to java files, etc so that I can start modifying the templates and related files for my custom theme.

Looking forward for your comments.

Thanks.
thumbnail
André Luiz de Noronha, módosítva 15 év-val korábban

RE: Template modifications for Custom Themes

New Member Bejegyzések: 12 Csatlakozás dátuma: 2008.06.04. Legújabb bejegyzések
i think the boolen is as if the 'if' clause stands for a question:

#if ($has_navigation)


like: if it has a navigation bar here do.......

otherwise:

#if ($company_logo != "")


if the variable company_logo is different from "" do.......

----

I'm looking for answears like yours...
if i had a HTML ready design , can i put it directly on the template folder, with the Velocity codes included?
does liferay read my html files, or i have to convert it to vm files?

thanx
thumbnail
André Luiz de Noronha, módosítva 15 év-val korábban

RE: Template modifications for Custom Themes

New Member Bejegyzések: 12 Csatlakozás dátuma: 2008.06.04. Legújabb bejegyzések
i got some interesting things here...

http://www.javaworld.com/javaworld/jw-12-2001/jw-1228-velocity.html?page=1

=]
Darshini G Swamy, módosítva 15 év-val korábban

RE: Template modifications for Custom Themes

New Member Bejegyzések: 3 Csatlakozás dátuma: 2008.01.16. Legújabb bejegyzések
Hi Joseph,

The velocity variables are put in a map in the VelocityVariables.java class.
And the variables are set in the html\themes\_unstyled\templates\init.vm

In your theme, in the init.vm, you include the above mentioned file, which has access to all the variables.

Thanks,
Darshini