Use Case: In one portal instance we have a 2 websites Ex: EClassRoom and EMeetings.
Now you want apply themes to them.
But both sites will have the same theme structure but some content is changed, Like in EClassRoom website you want show footer like "powered By www.eclassRoom.com"and in EMeetings website you want show footer like "powered By www.emeetings.com"
To fulfil the above scenarios we need to develop 2 themes with same structure, only because of footer content if different for both of them
Follow the below steps to achieve it:
Step 1: create plugin project with theme
File --> New--> Liferay plugin project --> enter name.
Check theme and finish.
Step 2: open liferay-look-and-feel.xml and configure below properties
<theme id="eclassroom" name="E-Class Room Theme">
<setting key="theme-id" value="eclassroom" />
<theme id="emeetings" name="E-Meetings Room Theme">
<setting key="theme-id" value="emeetings" />
Step 3: create templates folder under _diffs :docroot/_diffs/templates
Step 4: copy portal_normal.vm file from "docroot/templates/" to "docroot/_diffs/templates"
Step 5: Replace the default footer section with the following lines of code:
#set ($isEcrOrEmtgsThm = $theme.getSetting("theme-id"))
#if ($isEcrOrEmtgsThm == "eclassroom")
#language ("powered-by") <a href="http://www.eclassroom.com" rel="external">eclassroom.com</a>
// if you want you can include other velocity file by creating vm file in docroot/_diffs/templates like: // //#parse ("$full_templates_path/footerEclassroom.vm")
#language ("powered-by") <a href="http://www.emeetings.com" rel="external">emeetings.com</a>
// if you want you can include other velocity file by creating vm file in docroot/_diffs/templates like: //#parse ("$full_templates_path/footerEmeetings.vm")
Step 6:Build and deploy the theme file.
Step 7 : open control panel click on look and feel their you should be able to see both the eclassroom and emeetings themes and apply any one of them to test it.
Based on the theme to be selected,you able to see your footer changes.