Rate this page:
The themes can be configured via the Configuration link on the Choose Theme page on both the space and global level.
For example, the Left Navigation Theme allows for the specification of the title of the page which page should be used for navigation. The XWork module allows for developing complex configurations for themes, which can be saved in a config file.
Specify the path to the configuration action in the atlassian-plugin.xml:
1 2 3 4 5 6 7 8 9
<theme key="dinosaurs" name="Dinosaur Theme"
class="com.atlassian.confluence.themes.BasicTheme">
<description>A nice theme for the kids</description>
<colour-scheme key="com.example.themes.dinosaur:earth-colours"/>
<layout key="com.example.themes.dinosaur:main"/>
<layout key="com.example.themes.corporate:mail-template"/>
<param name="space-config-path" value="/themes/dinosaurs/configuretheme.action"/>
<param name="global-config-path" value="/admin/themes/dinosaurs/configuretheme.action"/>
</theme>
Note that two new parameters have been specified in the above xml.
As themes can be specified either on a global or space level, different configuration actions can be implemented for each level. If there is no need for configuration on a level, simply don't specify the config path.
Specify the configuration actions via the Xwork plugin module.
Define two packages, one for the space-level and one for the global configuration.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
<xwork name="themeaction" key="themeaction">
<package name="dinosaurs" extends="default" namespace="/themes/dinosaurs">
<default-interceptor-ref name="defaultStack" />
<action name="configuretheme" class="com.atlassian.confluence.extra.dinosaurs.ConfigureThemeAction" method="doDefault">
<result name="input" type="velocity">/templates/dinosaurs/configuretheme.vm</result>
</action>
<action name="doconfiguretheme" class="com.atlassian.confluence.extra.dinosaurs.ConfigureThemeAction">
<result name="success" type="redirect">/spaces/choosetheme.action?key=${key}</result>
</action>
</package>
<package name="dinosaurs-admin" extends="default" namespace="/admin/themes/dinosaurs">
<default-interceptor-ref name="defaultStack" />
<action name="configuretheme" class="com.atlassian.confluence.extra.dinosaurs.ConfigureThemeAction" method="doDefault">
<result name="input" type="velocity">/templates/dinosaurs/configurethemeadmin.vm</result>
</action>
<action name="doconfiguretheme" class="com.atlassian.confluence.extra.dinosaurs.ConfigureThemeAction">
<result name="success" type="redirect">/admin/choosetheme.action</result>
</action>
</package>
</xwork>
Note that the config-path parameters specified above matches the namespace plus the name of the action.
For example, given the above atlassian-plugin.xml, the configuretheme action would be accessed at
1
http://yourserver/confluence/themes/dinosaurs/configuretheme.action
Rate this page: