Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,461,221
Community Members
 
Community Events
176
Community Groups

Which templates do you prefer "Velocity" or "SOY"?

As you know Confluence add-on may be built using "Velocity" (https://developer.atlassian.com/confdev/development-resources/confluence-architecture/confluence-internals/velocity-template-overview) or "SOY" (https://developer.atlassian.com/confdev/tutorials/writing-soy-templates-in-your-plugin) templates.
Which one do you prefer and why?
Which would you advise to use for a large project, built on the Confluence API?

1 comment

You won't usually have much choice. Generally:

  • The initial result of actions (xwork or webwork) is generally* displayed with Velocity,
  • Only SOY templates can be used for client-side rendering, for example in JS when you need to render a subset of the page. Note that SOY templates can also be used on the server-side, that is why they exist.

So, most plugins have both. If you do succeed to use SOY everywhere:

  • (+) You'll have only one template to teach your colleagues/employees,
  • (-) If you want to build a page that has similar features as one in the core of Confluence, you won't be able to start with copy-pasting the .vm code. You'll have to translate it into .soy, and it will be error-prone.
  • (-) I don't know what is the performance of server-side rendering of Soy and Velocity, but I don't suspect you can do better than Velocity.

So... most plugins keep both templates.

*although it seems you can display the result of an action using Soy, according to this excerpt from the source of Confluence:

<result name="success" type="soy">
<param name="location">confluence.web.resources:auditlog/Confluence.Templates.Auditing.Page.auditLogPage</param>
</result>

Comment

Log in or Sign up to comment
TAGS

Atlassian Community Events