Like Alimozzaman in his blog, we tried to search for the official theme variables for Liferay 6.1 and the closest thing we can find is a documentation which we believe its for Liferay 4.3. We managed to locate the init.ftl at ${liferay}\${tomcat}\webapps\ROOT\html\themes\classic\templates.
We tried to sort the variable according to the variable type and its importance. Do feel free to comment, if we make a mistake or help us to fill in the description for some of the variables, thanks
Theme Specific Variables
- $theme_display / $themeDisplay
The theme display object (com.liferay.portal.theme.ThemeDisplay)
Javadoc: ${liferay 6.1 javadoc}/javadocs/com/liferay/portal/theme/ThemeDisplay.html - $portlet_display / $portletDisplay
The portlet display object (com.liferay.portal.theme.PortletDisplay)
Javadoc: ${liferay 6.1 javadoc}/javadocs/com/liferay/portal/theme/PortletDisplay.html - $css_class
The css class specified for the “color scheme” in the liferay-look-and-feel.xml, together with other css conditions like:
<#if liferay_toggle_controls = “visible”>
<#assign css_class = css_class + ” controls-visible” />
<#else>
<#assign css_class = css_class + ” controls-hidden” />
</#if> - $theme_settings
Theme’s settings - $theme_timestamp
Theme’s latest deployment timestamp (expressed in long) - $css_folder
Relative path to the css directory - $images_folder
Relative path to the images directory - $javascript_folder
Relative path to the javascript directory - $templates_folder
Relative path to the templates directory - $full_css_path
- $full_templates_path
- $css_main_file
Relative path to the theme’s main css file (main.css) - $js_main_file
Relative path to the theme’s main javascript file (main.js)
Company Specific Variables
- $company_id
Company’s id - $company_name
Company’s name (defined at Control Panel > Portal > Portal Setting, Name field) - $company_logo
Relative path to the company’s logo (defined at Control Panel > Portal > Display Setting, Logo field) - $company_logo_height
The height of the company’s logo (pixel) - $company_logo_width
The width of the company’s logo (pixel) - $company_url
Company’s home url (defined at Control Panel > Portal > Portal Setting, Home URL field)
Liferay Classic Theme Specific Variables
- $liferay_toggle_controls
- $page_group
- $liferay_dockbar_pinned
References:
- Liferay Wiki – Access Objects from Velocity
- Liferay 6 Theme Variables by Alimozzaman
- Liferay Official Theme Variables Documentation (which we believed its for Liferay 4.3)
- http://zh.sourceforge.jp/projects/sfnet_lportal/releases/
- http://www.liferay.com/zh/community/wiki/-/wiki/Main/Access+Objects+from+Velocity