<!-- <?php $this->showTemplateVars(); ?> -->
This is the most important line you will use when modifying your templates and adding custom code -- e.g. pop-up teasers, special mootools effects, or just plain knowing which variables to write out where.
(use the view|source to see the variables)
Place this in the first line of your template code, e.g. news_latest.tpl, etc.
Enjoy.
Re: <!-- <?php $this->showTemplateVars(); ?> -->
Very nice!
Or alternatively you might use:
Code:
<pre><?php $this->showTemplateVars(); ?></pre>
This will mess up most views, but if you are interested in the available variables this saves you the view source. Both options have pros and cons ;)
Re: <!-- <?php $this->showTemplateVars(); ?> -->
Quote:
Originally Posted by Vera
Very nice!
Or alternatively you might use:
Code:
<pre><?php $this->showTemplateVars(); ?></pre>
This will mess up most views, but if you are interested in the available variables this saves you the view source. Both options have pros and cons ;)
and/or replace the tag with tag if the template variables contains html code :)
Re: <!-- <?php $this->showTemplateVars(); ?> -->
Wow - that's super helpful! It just helped me out with a custom news template I was working on. I feel like I've been flying blind on non-catalog templates before knowing this trick.
Re: <!-- <?php $this->showTemplateVars(); ?> -->
That is helpful....
I tried all three, and the winner is
........drrrrrrrrrrrrrrrrrrrr
drumroll please...
drrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr rrr
do-do-do-doot-do-do.
.
.
.
.
. Fllllllllooooo..vverrrrr..fl.vvv...THYON!
For the ease of being able to read the vars alongside of your non-broken up page.
Thanks for the tips all.
Re: <!-- <?php $this->showTemplateVars(); ?> -->
I came up with an interesting solution to put the variables in a lightbox, but this forum doesn't seem to like my code. I'll keep adding pieces here until it blows up.
I got things working in a lightbox (mediabox) with the following code. The only problem is that I can't get the overflow to scroll properly. Maybe someone here knows how to get this working. Add "overflow: scroll;" to the div style didn't work.
Code:
template variables
<div id="mb_variables" style=(quote)display: none;(quote)><pre><?php $this->showTemplateVars(); ?></pre></div>
For some reason this forum rejects the code so you'll need to replace where it says (quote) with " in line 2 above.