Solved
Forum Discussion
DougS
8 years agoKhoros Oracle
I believe you should be able to do something like this:
#set ($splitPath = urlPath.split(",")) #foreach ($path in $splitPath) ${path} #end
-Doug
ttadej
8 years agoAdvisor
Thanks DougS
We ended up doing this, which seems excessive but worked:
#set ($postUrl = $notification.message.webUi.url) #if ($postUrl.contains('#')) #set ($splitPostUrl = $postUrl.split('#')) #foreach ($part in $splitPostUrl) #if ($velocityCount == 1) #set ($urlPath = $part) #elseif($velocityCount == 2) #set ($urlHash = $part) #end #end <a href="$!{urlPath}?${utmTag}#$!{urlHash}"> #else <a href="${postUrl}?${utmTag}"> #end
This isn't much documentation here: https://velocity.apache.org/engine/1.5/user-guide.html#loops
Unfortunately $arr.get(index) does not seem to work even though Lithium is using Velocity v1.5