Just thought I'd share this snippet of SMT code. It's a quick and easy way to debug data, such as l.settings:products (or whatever data you want), on the page. It's not new or anything, but clients I've shared it with have found it to be a good time saver.
First it checks to see if "debug" is turned on so no one but you sees it.
Then it serializes the data (turns into a more "readable" format (if we're lucky)) and puts in line breaks for easy reading.
Put this code snippet in the page template where you want to see the data:
The g.__debug part keeps it hidden from anyone but you. To see the debug info add one of the following to the end of the url.
If it's a .HTML url: ?__debug=1
If it's a URL with data and there's already a ? symbol: &__debug=1
First it checks to see if "debug" is turned on so no one but you sees it.
Then it serializes the data (turns into a more "readable" format (if we're lucky)) and puts in line breaks for easy reading.
Put this code snippet in the page template where you want to see the data:
Code:
<mvt:if expr="g.__debug EQ 1"> <mvt:eval expr="glosub(miva_array_serialize(l.settings:products),',','<br>'))" /> </mvt:if>
If it's a .HTML url: ?__debug=1
If it's a URL with data and there's already a ? symbol: &__debug=1