Theme Policy

Theme policy allows you to control how a theme is rendered on a page. If you want two different versions of the theme one that needs bread crumb and other that does not then you can create a theme policy with isBreadCrumbRequired flag create two different theme policies one with value of this flag true and other with value equal to false and apply that policy correspondingly. You will also have to change your theme implementation i.e. jsp or .jspf pages so that it reads value of isBreadCrumbRequired flag from the ThemePolicy on the page and uses it display or hide bread crumb.

IBM's Server side as well as client side aggregation theme makes heavy use of Theme Policies. And portal ships ten different policies that you can use with IBM theme to control there look and feel

You can create a policy file using either the Theme Customizer portlet or open the existing theme policy in notepad modify it and import it into portal using XMLAccess.

You can apply theme policy to portlet using two options
XML Configuration Interface: Using the page metadata attribute com.ibm.portal.ThemePolicy
Properties Portlet: You can choose the Theme policy that you want to apply to the page from the Theme Style select box.
Theme policy is inherited so it only needs to be set on a page which requires a different policy than its parent.

A theme policy is made up of several attributes. Each attribute controls one aspect of the theme. For example, the Boolean renderBreadCrumb attribute controls whether the bread crumb will be displayed while the breadCrumbMaxLevels attribute controls the number of steps listed in the bread crumb when it is displayed.

You can look at all the theme policies that are installed on your server by exporting them using this xmlaccess script

<?xml version="1.0" encoding="UTF-8"?>
<request xsi:noNamespaceSchemaLocation="PortalConfig_1.4.xsd"
create-oids="true" type="export"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

<portal action="locate">
<policy-node action="export" label="WebPage"
type="theme" path="">
<url>file:///c:/temp/exportThemePolicies.xml</url>
</policy-node>
</portal>
</request>

All the theme policies will be exported into c:/temp/exportThemePolicies.xml file.

7 comments:

Ratul said...

Hello sunil, can you advise how to use theme policy in portal 8?

RishiA said...

Hi Ratul....did you figure out how to implement theme policy in portal 8?. I need to do the same. Thanks.

Ratul said...

yes I sorted it out. There is no IBM way of doing it. So we got rid of it. Created our own pojo objects and mapped them in a similar fashion. Email me @ bhattacharya.ratul@gmail.com for more details if you need to.

Anonymous said...

Hi Rahul,
I need the info...I just dropped one email to you.

Regards,
Swatishree

Ratul said...

I didnt get any email.

Anonymous said...

Can you please let me know whether you receive the email today or not. I send it again.

Regards,
Swatishree

IDesignPassion said...

Thank you for sharing article with us. It is reaaly awesome. Keep posting such information.
Custom website design Phoenix