We can define a settings for a theme to be configurable by Site Administrators.As part of settings we can configure a checkbox,text,textarea and select.
Lets learn how to add configurable setting to the theme
Adding Configurable Setting to a Theme
If you go through the previous post already i discussed how to create a custom theme.You can understand this concept only if you are aware of custom theme creation.
Usecase: I want to give the configurable setting to administrator to show the footer of the page
1. Create a theme
2. Open liferay-look-and-feel.xml under docroot/WEB-INF
3. Add <settings></settings> tag in between the theme's <theme></theme> tags
4. Add a <setting> element in between <settings></settings> tags as many as you want.
5.To make a setting configurable from the portal, you must add the attribute "configurable=true" to the <setting></setting> element
6. Now go to the organization which you have applied the theme.(Organization name for myself:liferaygnosis) And the URL will be like as follows
http://localhost:8686/web/liferaygnosis/home
7. Login as a Site Administrator and Goto the SiteAdministration under Admin control
8. Under Look and Feel section you can observe the settings for the theme which is for giving the provision to Site Administrator weather to display Power by company or not on the page
Now lets do the actions:
By default liferay page shows the Powered by Company name as follows
8. Now lets go to the theme settings and uncheck checkbox for Display Powered by as i said earlier how to go there.
9. Then refresh the organization page and observe the screen as there is no Powered by
In this way we give the provision to the SiteAdministrator to configure Theme Settings
Default setting type is input text filed
Lets learn how to add configurable setting to the theme
Adding Configurable Setting to a Theme
If you go through the previous post already i discussed how to create a custom theme.You can understand this concept only if you are aware of custom theme creation.
Usecase: I want to give the configurable setting to administrator to show the footer of the page
1. Create a theme
2. Open liferay-look-and-feel.xml under docroot/WEB-INF
3. Add <settings></settings> tag in between the theme's <theme></theme> tags
4. Add a <setting> element in between <settings></settings> tags as many as you want.
5.To make a setting configurable from the portal, you must add the attribute "configurable=true" to the <setting></setting> element
6.2.0+
6. Now go to the organization which you have applied the theme.(Organization name for myself:liferaygnosis) And the URL will be like as follows
http://localhost:8686/web/liferaygnosis/home
7. Login as a Site Administrator and Goto the SiteAdministration under Admin control
8. Under Look and Feel section you can observe the settings for the theme which is for giving the provision to Site Administrator weather to display Power by company or not on the page
Now lets do the actions:
By default liferay page shows the Powered by Company name as follows
8. Now lets go to the theme settings and uncheck checkbox for Display Powered by as i said earlier how to go there.
9. Then refresh the organization page and observe the screen as there is no Powered by
In this way we give the provision to the SiteAdministrator to configure Theme Settings
No comments:
Post a Comment