Confluence plugins: How to use custom .vm files properly?


I'm quite new to plugin development but had some success already :-)

Right now I'm playing around with web panels for displaying information in certain places.

What I didn't get is: What do I have to do to make velocity-stuff really work?

According to this example I created a new .vm-file that holds my code and defined it as resource location in the xml:

<web-panel key="myPanel" location="atl.dashboard.left" weight="1" >
   <resource name="view" type="velocity" location="velocity/myupdates.vm"/>

My .vm just contains this for testing purpose:


The result:

I get the webpanel displayed, the .vm is loaded but obviously am I missing something, because all I see is "$"

I can use #set and all this stuff, but I seem to lack the connection to the classes that provide the data. What do I have to do?

Thanks in advance!

1 answer

0 votes

Webpanel will not have an action object in context. You will have to add the objects you want to display in to the template context using a context provider.

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Oct 24, 2018 in Confluence

Atlassian Research opportunity with Confluence templates

Do you use templates with Confluence? Take part in a remote 1-hr workshop. You'll receive USD $100 for your time!   We're looking for people to participate in a   remote 1-hr workshop...

1,100 views 17 14
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