1 Reply Latest reply on Jun 16, 2016 11:06 PM by fusion35

    Variables available in Soy and FTL files


      Hello, all.


      I am looking for a list of variables available in Soy/FTL theme files. Is anyone aware of any documentation around this?


      For instance, in the '/template/docs/document.ftl' theme file, we have access to ${document} where we can call things like ${document.subject} and ${document.docID}and ${container} with it's own properties and methods.


      The initial goal around this is to look into a method of providing the contentID of a piece of content as a JS variable or HTML element on the page at load time, rather than needing a separate entityDescriptor API call, but I think with access to a list, the possibilities could become endless.




        • Re: Variables available in Soy and FTL files

          Johnny :

          Variables that are  in the context are made available by the action that user is calling. In the instance sighted above, DocumentAction makes the document variable available in the context. Other than that you may also like to take a look at the  template.soy to see what variable are available for use and javascript.soy, to see what JS variable are already there.