<?xml version="1.0" encoding="UTF-8" standalone="yes"?><extensionVersion xmlns="http://www.xwiki.org/extension"><id>org.xwiki.platform:xwiki-platform-rendering-macro-velocity</id><name>XWiki Platform - Rendering - Macro - Velocity</name><type>jar</type><rating><totalVotes>0</totalVotes><averageVote>0.0</averageVote></rating><summary>XWiki Platform - Rendering - Macro - Velocity</summary><description>Executes [[Velocity&gt;&gt;http://velocity.apache.org/]] on the content of the macro.&#13;
&#13;
= Usage =&#13;
&#13;
{{code language="none"}}&#13;
{{velocity filter="..." output="..." wiki="..."}}&#13;
...content here...&#13;
{{/velocity}}&#13;
{{/code}}&#13;
&#13;
What's important to understand is that the Velocity engine will execute first on the content and then only, if ##wiki## is ##true## (which is the default) , the resulting content will be parsed using a wiki content parser.&#13;
&#13;
{{warning}}&#13;
Since Velocity executes first, if you put an {{{{{include}}}}} macro inside the {{{{{velocity}}}}} macro you will not be able to use any Velocity macro/variable defined in the included page because the include is done after Velocity is executed. Thus, take care of putting the {{{{{include}}}}} macro outside of  the {{{{{Velocity}}}}} macro or use the defined macro/variable in a separate {{{{{velocity}}}}} macro, as in:(((&#13;
{{code language="none"}}&#13;
{{velocity}}&#13;
## Note: The included page defines a $var variable in this example&#13;
{{include reference="somepage"/}}&#13;
## Note: Calling $var here won't work since it would be executed before the include is done&#13;
{{/velocity}}&#13;
&#13;
{{velocity}}&#13;
$var&#13;
{{/velocity}}&#13;
{{/code}}&#13;
)))&#13;
{{/warning}}&#13;
&#13;
== Parameters definition ==&#13;
&#13;
Velocity macro extends [[Script Macro]] and support all its parameters (except the ##language## selection which is always ##velocity##).&#13;
&#13;
Following are Velocity macro specific parameters:&#13;
&#13;
|=Name|=Optional|=Allowed values|=Default value|=Description&#13;
|filter|yes|none/html/indent|indent|Indicate a filter to apply on velocity content before and after script execution. The default filter (##indent##) remove all first whites spaces of lines to support code indentation. See [[Velocity Macro Filter]] for more details.&#13;
&#13;
== Example1 ==&#13;
&#13;
{{code language="velocity"}}&#13;
{{velocity}}&#13;
#set($words = ["Some", "velocity", "code"])&#13;
#foreach($word in $words)&#13;
  $word ##&#13;
#end&#13;
{{/velocity}}&#13;
{{/code}}&#13;
&#13;
Result:&#13;
&#13;
{{code language="none"}}&#13;
Some velocity code&#13;
{{/code}}&#13;
&#13;
== Example2 ==&#13;
&#13;
Shows how to do some dynamic include.&#13;
&#13;
{{code language="velocity"}}&#13;
{{velocity}}&#13;
#if (... some condition...)&#13;
  #set ($ref  = "page1")&#13;
#else&#13;
  #set ($ref  = "page2")&#13;
#end&#13;
{{include reference="$ref"/}}&#13;
{{/velocity}}&#13;
{{/code}}&#13;
&#13;
This will include ##page1## or ##page2## depending on the condition.&#13;
&#13;
= XWiki Standard Velocity Macros = &#13;
&#13;
[[Velocity Macros (a.k.a Velocimacros)&gt;&gt;https://velocity.apache.org/engine/devel/user-guide.html#velocimacros]] are a feature of the Velocity engine. XWiki provides several of them inside the ##macros.vm## template file, that you can use in your wiki pages or template files.&#13;
&#13;
{{display reference="Extension.Velocity Macro.Macros.WebHome"/}}</description><licenses><name>GNU Lesser General Public License 2.1</name></licenses><website>http://extensions.xwiki.org/xwiki/bin/view/Extension/Velocity%20Macro</website><authors><name>XWiki Development Team</name><url>https://xwiki.org/xwiki/bin/view/XWiki/XWikiTeam</url></authors><scm><connection><system>git</system><path>git://github.com/xwiki/xwiki-platform.git/xwiki-platform-core/xwiki-platform-rendering/xwiki-platform-rendering-macros/xwiki-platform-rendering-macro-velocity</path></connection><developerConnection><system>git</system><path>git@github.com:xwiki/xwiki-platform.git/xwiki-platform-core/xwiki-platform-rendering/xwiki-platform-rendering-macros/xwiki-platform-rendering-macro-velocity</path></developerConnection><url>https://github.com/xwiki/xwiki-platform/tree/master/xwiki-platform-core/xwiki-platform-rendering/xwiki-platform-rendering-macros/xwiki-platform-rendering-macro-velocity/</url></scm><issueManagement><system>jira</system><url>https://jira.xwiki.org/browse/XWIKI</url></issueManagement><recommended>false</recommended><properties><key>maven.groupid</key><stringValue>org.xwiki.platform</stringValue></properties><properties><key>maven.artifactid</key><stringValue>xwiki-platform-rendering-macro-velocity</stringValue></properties><properties><key>maven.Model</key><stringValue>org.xwiki.platform:xwiki-platform-rendering-macro-velocity:jar:18.7.0</stringValue></properties><properties><key>xwiki.extension.recommendedVersions.commons</key><stringValue>org.xwiki.commons:.*/[18.7.0]</stringValue></properties><properties><key>xwiki.extension.recommendedVersions.platform</key><stringValue>org.xwiki.commons:.*/[18.7.0],
      org.xwiki.rendering:.*/[18.7.0],
      org.xwiki.platform:.*/[18.7.0]</stringValue></properties><properties><key>xwiki.extension.recommendedVersions</key><stringValue>org.xwiki.commons:.*/[18.7.0],
      org.xwiki.rendering:.*/[18.7.0],
      org.xwiki.platform:.*/[18.7.0]</stringValue></properties><version>4.4</version><repositories><id>maven-xwiki</id><uri>https://nexus.xwiki.org/nexus/content/groups/public</uri><type>maven</type></repositories></extensionVersion>