solved Creating a test template

Clay Gordon
Clay Gordon
@claygordon
9 years ago
733 posts
I want to create a standalone test template like the one shown in the {debug} video.

At some point, either Brian or Paul may have added one or more test templates in my working skin's templates directory.

What I want to do is isolate some code at a URL known only to me so I can test it.

In particular, I am looking to test the code I mention in Question 3 in this post:
https://www.jamroom.net/the-jamroom-network/forum/ning-to-jamroom/22325/profile-page-latest-forums-changing

What do I need to include to make sure it works? This is my first shot at it.

{assign var="selected" value="home"}
{* Include Header File *}
{jrCore_include template="header.tpl"}


    {* BEGIN Container *}
    <div class="container">

        {* BEGIN TEST CODE *}
        <div class="row">
        
        {* PUT TEST CODE HERE *}
        
        </div>
        {* END TEST CODE *}
    </div>
    {* END Container *}

{* Include Footer File *}
{jrCore_include template="footer.tpl"}

updated by @claygordon: 02/25/15 07:25:42AM
paul
@paul
9 years ago
4,326 posts
Just create a template file in your default skin called test.tpl, say and add the above code to it. Then run http://thechocolatelife.com/test


--
Paul Asher - JR Developer and System Import Specialist
Clay Gordon
Clay Gordon
@claygordon
9 years ago
733 posts
Paul -

The test.tpl file is there. Along with test_row_1.tpl and test_row_2.tpl. I am pretty sure these are not part of the default skin?
paul
@paul
9 years ago
4,326 posts
They are likely left over from something I did. They are not part of the skin so use them. If you are trying a jrCore_list you might be wanting the row template as well.


--
Paul Asher - JR Developer and System Import Specialist
Clay Gordon
Clay Gordon
@claygordon
9 years ago
733 posts
I am looking for the name of the group ... in jrGroup somewhere? I used the category name on the home page so it may be similar?
michael
@michael
9 years ago
7,715 posts
Add a template to the active skin and the url you can find it at is the name of the template.

if you add a template called avacardos.tpl you can find it at:
yoursite.com/avacardos

add wellington.tpl and it comes out at
yoursite.com/wellington

What variables are available in that template can be seen by adding {debug}.

Not all templates contain the same variables, so put {debug} where you want to know what is available.

eg:

If wellington.tpl contains
{jrCore_list  module="jrAudio" template="a_custom_audio_template.tpl"}

Then {debug} inside a_custom_audio_template.tpl will also contain all the jrAudio stuff that got found from the jrCore_list call.
Clay Gordon
Clay Gordon
@claygordon
9 years ago
733 posts
I tried this yesterday and instead of popping up a window the options were being written into the page. I guess I was inside a foreach loop (?) and so I had to crash the browser to exit.
michael
@michael
9 years ago
7,715 posts
Yeah pays to not put {debug} inside a foreach loop as debug window will need to re-generate for every loop which will take a long time if there are many loops. Put it after that. You'll only ever get 1 window anyhow.

If your getting output to the page, then try
{debug output="javascript"}

That structure doesn't show up in smarty 3 docs but used to be used in smarty2.

Smarty3 debug docs:
http://www.smarty.net/docs/en/language.function.debug.tpl

(old) Smarty2 debug docs:
http://www.smarty.net/docsv2/en/language.function.debug.tpl
Clay Gordon
Clay Gordon
@claygordon
9 years ago
733 posts
Adding

{debug output="javascript"}

to my test template generates

There is a syntax error in your template - please fix and try again

upon saving
michael
@michael
9 years ago
7,715 posts
yeah, ok, stick with {debug}.

Tags