I want to create a custom navigation menu using Angular JS and a skin extension. My current problem is that my mixed in Velocity doesn’t seem to be parsed. Here’s a snippet that i put into a JavaScriptExtension object:
var tree = #documentTree({
'showTranslations' : 'false',
"root" : "document:Products.WebHome",
"filterHiddenDocuments" : "true",
"showAttachments" : "false",
"compact" : "true" :
"limit" : "25",
"openTo" : "document:$openToDoc"
});
console.log(tree);
This results in an uncaught exception since the resulting JS that is executed is exactly what is above; it’s not parsed. I’ve tried other Velocity snippets and they work.
I’ve also tried:
{{template name="documentTree_macros.vm" /}}
{{velocity}}
{{html}}
#documentTree({})
{{/html}}
{{/velocity}}
Which also isn’t parsed and the resulting JS is exactly as above.
Perhaps using a DocumentTree is not the optimal way for building a custom navigation menu? Maybe there is a way to loop through all of the documents in the wiki and use JS to create HTML elements for them. Or am I using Velocity wrong?
Thank you !