Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

The default template directory is passed to the page through a templateDir variable. To change the template dirctory for a page, use the set tag to change the templateDir variable. The variable can be changed using a static value or property.

Static Value

Change to the "template" directory.

Code Block

<s:set 

...

name="templateDir" value="

...

'template'" scope="page" />

...


Note

This will set the attribute 'templateDir' in the page scope, with the value of what that is returned by 'myTemplateDir' in the stack, eg. the action class might have a getMyTheme method that return a String called template, to indicate what the template directory is within the classpath.

Property

Change to the theme name indicated by the myTemplateDir property.

Code Block

<s:set name="theme" value="%{myTemplateDir}" 

...

scope="page" />

...


...

See also Template Loading