« Back

Dumping ADT+WCM Template Variables

General Blogs February 18, 2014 By James Falkner

Ever wonder what exactly is available to you as a WCM Template author, or ADT wizard, or Theme developer? Ever forget the name of that weird request variable that gives you the current URL? Or wonder what happened to VelocityVariables in 6.2? Of course you have. Well, wonder no more! With this handy context dumper, you can see all of the available utilities, variables, their values, and their callable methods from your template, ADT, or theme context. Here's what it looks like:

It also dumps a hierarchical view of the request variable at the bottom of the listing, for ADTs and WCM Templates:

Just copy and paste this code into your theme (should be compatible with 6.2 and 6.1), ADT or WCM template, and explore. If I had more skills as a designer I'd make this into some kind of auto-expanding AlloyUI table with music. But I don't, so I can't. Any volunteers?

 

Special thanks to Chaquotay for the base code. I had to modify it because if you try to do a deep expansion of everything (i.e. the .data_model special variable), it opens a black hole in your server as it recursively tries to expand everything in the universe.

Threaded Replies Author Date
Awesome script for ADT writers Daniele Baggio February 18, 2014 8:26 AM
Not wrong, this is a very useful script.... ... mARK aNDREWS December 16, 2014 8:59 AM
thanks for the script, awesome!!!! Jorge Pineda January 14, 2015 7:09 AM
Hi, this is indeed very useful! I have been... s s April 19, 2015 5:50 PM
ok; found this bit of generic fm that returns... s s April 21, 2015 8:15 AM

Awesome script for ADT writers
Posted on 2/18/14 8:26 AM.
Not wrong, this is a very useful script.... Still not sure where I find my structure elements though! Any clues?
Posted on 12/16/14 8:59 AM.
thanks for the script, awesome!!!!
Posted on 1/14/15 7:09 AM.
Hi, this is indeed very useful! I have been able to use pieces of it but having problems with the "<#assign foo = something.in["your"].data[0].model />" concept in your note. I know for example, that a ADT for a Journal display has the container <#list entries as entry> available. But this does not seem to work for an web-content-display template and what else is available? I found from your code that 'request' is available and can parse that with freemaker. When a web-content-display template is invoked is the 'article' passed in as a container (or an article id that is supposed to be used in an #assign and then regular freemarker can kick in?)? I've seen the examples of reserved-words use but seems to be just as one-off special cases. Is there not a container for them (e.g. ${reserved.user_id}) so that the freemarker 'way' can be maintained?
Posted on 4/19/15 5:50 PM.
ok; found this bit of generic fm that returns the data model;
<#list .data_model?keys as key>
${key}
</#list>
Now just have to figure out if what I need is in there somewhere.
Posted on 4/21/15 8:15 AM in reply to s s.