Packaging overwritten decorator vmd files as a Confluence plugin?

I've customized a couple of the vmd files that are present in the <confluence install dir>/confluence/decorators/components/ folder. I've been able to manually copy the customized files and place them there and restart confluence and every thing works fine. But I'd like to package these files in a Confluence plugin and deploy them that way. Is this doable? I've looked at the layout and decorator tags for atlassian-plugin.xml, but haven't figured out a way to get these vmd files in the right folder at deployment time.

1 answer

1 accepted

I found this by looking at the documentation theme plugin (it is in the atlassian-plugin.xml file inside the atlassian-plugin tag) :

&lt;layout key="main" name="Main Decorator" class="com.atlassian.confluence.themes.VelocityDecorator" overrides="/decorators/main.vmd"&gt;
            &lt;resource type="velocity" name="decorator" location="doctheme/decorators/main.vmd" /&gt;
    &lt;/layout&gt;
    &lt;layout key="page" name="Page Decorator" class="com.atlassian.confluence.themes.VelocityDecorator" overrides="/decorators/page.vmd"&gt;
            &lt;resource type="velocity" name="decorator" location="doctheme/decorators/page.vmd" /&gt;
    &lt;/layout&gt;

This overwrites the main.vmd and page.vmd in "<confluence install dir>/confluence/decorators/" with your main.vmd and page.vmd files located relative to your atlassian-plugin.xml in this folder : "doctheme/decorators/"

If you want to develop a theme, you will also need to include these lines inside your theme tag in order to apply these decorators everywhere your theme is enabled :

&lt;layout key="the.key.of.your.plugin:main"/&gt;
        &lt;layout key="the.key.of.your.plugin:page"/&gt;

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Kesha Thillainayagam
Posted Friday in Confluence

We want to hear how your non-technical teams are using Confluence!

Hi Community! Kesha (kay-sha) from the Confluence marketing team here! Can you share stories with us on how your non-technical (think Marketing, Sales, HR, legal, etc.) teams are using Confluen...

246 views 11 9
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you