Liferay 6.1 Theme variables

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}webappsROOThtmlthemesclassictemplates.

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

  1. $theme_display / $themeDisplay
    The theme display object (com.liferay.portal.theme.ThemeDisplay)
    Javadoc: ${liferay 6.1 javadoc}/javadocs/com/liferay/portal/theme/ThemeDisplay.html
  2. $portlet_display / $portletDisplay
    The portlet display object (com.liferay.portal.theme.PortletDisplay)
    Javadoc: ${liferay 6.1 javadoc}/javadocs/com/liferay/portal/theme/PortletDisplay.html
  3. $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>
  4. $theme_settings
    Theme’s settings
  5. $theme_timestamp
    Theme’s latest deployment timestamp (expressed in long)
  6. $css_folder
    Relative path to the css directory
  7. $images_folder
    Relative path to the images directory
  8. $javascript_folder
    Relative path to the javascript directory
  9. $templates_folder
    Relative path to the templates directory
  10. $full_css_path
  11. $full_templates_path
  12. $css_main_file
    Relative path to the theme’s main css file (main.css)
  13. $js_main_file
    Relative path to the theme’s main javascript file (main.js)

Company Specific Variables

  1. $company_id
    Company’s id
  2. $company_name
    Company’s name (defined at Control Panel > Portal > Portal Setting, Name field)
  3. $company_logo
    Relative path to the company’s logo (defined at Control Panel > Portal > Display Setting, Logo field)
  4. $company_logo_height
    The height of the company’s logo (pixel)
  5. $company_logo_width
    The width of the company’s logo (pixel)
  6. $company_url
    Company’s home url (defined at Control Panel > Portal > Portal Setting, Home URL field)

Liferay Classic Theme Specific Variables

  1. $liferay_toggle_controls
  2. $page_group
  3. $liferay_dockbar_pinned

References:

  1. Liferay Wiki – Access Objects from Velocity
  2. Liferay 6 Theme Variables by Alimozzaman
  3. Liferay Official Theme Variables Documentation (which we believed its for Liferay 4.3)

2 thoughts on “Liferay 6.1 Theme variables”

Leave a Reply to mygeekjourney Cancel reply

Your email address will not be published. Required fields are marked *