Confluence Docs 3.0 : Decorator Plugins This page last changed on Nov 03, 2008 by smaddox.
| Decorator plugin modules are available in Confluence 2.5 and later versions
Decorator plugin modules allow you to add decorators without using a Theme Plugin. For more information about plugins in general, read Confluence Plugin Guide. To learn how to install and configure plugins (including macros), read Installing and Configuring Plugins Manually. For an introduction to writing your own plugins, read Writing Confluence Plugins ## Decorator Plugin Module The following is an example `atlassian-plugin.xml` file containing a single decorator:
    <atlassian-plugin key="com.atlassian.confluence.extra.sample" name="Sample Plugin">
    ...
        <decorator name="myDecorator" page="myDecorator.vmd" key="myDecorator">
            <description>My sample decorator.</description>
            <pattern>/plugins/sampleplugin/*</pattern>
        </decorator>
    ...
    </atlassian-plugin>
the page attribute of `decorator` defines the name of the decorator resource file the pattern element defines the url pattern for which the decorator will be applied to (you can only have one pattern per decorator) ## Decorator resource file Decorator files are written in the Velocity templating language and have the VMD extension. The following is a sample decorator file:
    <html>
    <head>
        <title>$title</title>

        #standardHeader()
    </head>

    <div id="PageContent">
        <table class="pagecontent" border="0" cellpadding="0" cellspacing="0" width="100%">
        <tr>
            <td valign="top" class="pagebody">
                <div class="pageheader">
                     <span class="pagetitle">$title</span>
                </div>
                $body
             </td>
        </tr>
        </table>
    </div>

    </body>
    </html>
You can familiarise yourself with Velocity at the Velocity Template Overview and decorators in general at the Sitemesh homepage.

Document generated by Confluence on Nov 05, 2009 23:34