Finding Available Mura CMS Content with getAllValues()

One of the first things I wanted to know as I started working with Mura CMS templates, is how I can dump out all the available variables.

I'm used to the versatility of CFML's CFdump tag, outputting the contents of any query or other CF object to the page for easy reading and reference as I wire up the css and html to display the dynamic content. In Mura, where everything is returned by a 'bean' via specifically named CF functions, cfdump doesn't always have the expected results.

For example, in a content-driven page in mura, dumping out #$.content()# will show the methods available, but not the actual values they'll return for the page you're working on.

In comes another Mura one-liner "getAllValues()". This can be attached to almost any Mura root-level object, to show all the values available, just as if you were dumping out the results of a single cfquery record, struct or nested array.

So, to get all the available goodies for a standard page or content-based item, simply add the getAllValues() function at the end of your cfdump:


<cfdump var="#$.content().getAllValues()#">

This also works for other Mura beans, such as a Mura feed:


<cfdump var="#variables.feedBean.getAllValues()#">

or any record being parsed by Mura's "iterator":


<cfdump var="#arguments.item.getAllValues()#">

or even the content of another page, by ID:


<cfdump var="#application.contentManager.getActiveContent('[content id]', '[site id]').getAllValues()#">

or by filename (the filename is the name of the content-node, same as seen in url):


<cfdump var="#application.contentManager.getActiveContentByFilename('[filename]', '[siteid]').getAllValues()#">

As I understand it, most of these values are directly available via the CF request scope, but dumping out #request# in mura is huge, and takes a while to dig through. GetAllValues() is the one you want.

The Mura Docs list a number of methods for getting content via the Mura API. I believe the getAllValues() method can be used with all of the 'read' functions.

Comments (Comment Moderation is enabled. Your comment will not appear until approved.)
blogcfc 5.9.1.002 by raymond camden
contact michael evangelista