Share

Default variables defined in theme

These are the default Liferay 6 theme variables defined in init.vm.
I was searching but did not get any link ,so I hope this will help lot of
people also around  the globe. If anything goes  wrong, pls make a comment
and also try to add something that will help people around us.

## ———- Common variables ———- ##

$theme_display
$portlet_display
$theme_timestamp
$theme_settings
$css_class
$layout
$page_group
$liferay_toggle_controls
$liferay_dockbar_pinned
$css_folder
$images_folder
$javascript_folder
$templates_folder
$full_css_path
$full_templates_path
$css_main_file
$js_main_file
$company_id
$company_name
$company_logo
$company_logo_height
$company_logo_width
$company_url

$user_id
$is_default_user
$user_first_name
$user_middle_name
$user_last_name
$user_name
$is_male
$is_female
$user_birthday
$user_email_address
$language_id
$w3c_language_id
$time_zone
$user_greeting
$user_comments
$user_login_ip
$user_last_login_ip
$is_signed_in
$group_id

## ———- URLs ———- ##
$show_add_content
$add_content_text
$add_content_url
$layout_text
$layout_url
$show_control_panel
$control_panel_text
$control_panel_url
$show_home
$home_text
$home_url
$show_my_account
$my_account_text
$my_account_url
$show_page_settings
$page_settings_text
$page_settings_url
$show_sign_in
$sign_in_text
$sign_in_url
$show_sign_out
$sign_out_text
$sign_out_url
$show_toggle_controls
$toggle_controls_text
$toggle_controls_url
$update_available_url

## ———- Page ———- ##

$the_title
$selectable
$is_maximized
$is_freeform

$page_javascript_1
$page_javascript_2
$page_javascript_3
$layout
$page = $layout
$is_first_child
$is_first_parent
$the_title
$is_portlet_page

$all_portlets
$column_1_portlets
$column_2_portlets
$column_3_portlets
$column_4_portlets
$column_5_portlets
$maximized_portlet_id
$typeSettingsProperties
$page_javascript_1
$page_javascript_2
$page_javascript_3
$community_name
$css_class
$my_places_portlet_url
$community_default_public_url
$community_default_private_url
$community_default_url
$the_title
$layouts
$pages

## ———- Navigation ———- ##
$nav_items
$has_navigation

## ———- Staging ———- ##
$show_staging
$staging_text
## ———- My places ———- ##
$show_my_places
$my_places_text

## ———- Includes ———- ##
$dir_include
$bottom_include
$bottom_ext_include
$content_include
$top_head_include
$top_messages_include

## ———- Date ———- ##
$date
$current_time
$the_year

Extending and Overriding portal.properties

Hooks can be used to override the properties in portal.properties file.Not all properties can be overridden but the properties which are specified in the DTD of liferay-hook.xml for the liferay version you are running.

Now Let's take a property and customize it.As a liferay users all know about that "terms and condition" page will come when user first time logins into the portal.By default its value is true in properties file.

terms.of.use.required=true

1. Create a Hook Project
2. Open liferay-hook.xml under docroot/WEB-INF/liferay-hook.xml

 3.Open liferay-hook.xml.You can have the overview of the liferay-hook.xml as follows.In this
     select Portal properties folder from the outline pallet to bring up the customize liferay portal   
     properties option.


 4. Select the checkbox Customize Liferay Portal Properties and click on the three yellow 
    diamonds icon, Automatically portal.properties file will be created under docroot/WEB-INF/src.
    It is as follows
 5. And in the portal.properties file update the property to the false as follows

terms.of.use.required=false

6. Do the ant deploy

Test Case

1. Create an user
2. login to the portal
3. "terms of use" page will appear
4.  ant deploy of hook
5. Now create another user
6. login to the portal
7. No "terms of use" page will appear.