Debugging Skin Templates
Submitted Charles, Sep 26 2009 08:19 AM | Last updated Apr 27 2010 04:18 AM
The IP.Board 3.0 template engine is very powerful, especially with it's new template plugin system, and complex templates with lots of logic can be created rather easily. Most developers work with IPB with developer mode enabled, which means you use the simple syntax to create templates in the master_skin directory (the same syntax used in the ACP). Sometimes, however, you may have trouble determining what the final resulting PHP code IPB will generate will be once IPB has parsed the if/else/foreach tags, the php tags, and the template plugins on the skin template you are working on.
There is a simple way you can see this while developing. You must have IN_DEV (developer mode) enabled and be working on the master_skin templates to use this. Simply add the following line of code inside any template in any skin file that is being loaded on the page to see an output of the skin file itself.
You will get an output of the skin file after parsing and replacements have been completed, allowing you to verify that the resulting PHP code is what you expect.
There is a simple way you can see this while developing. You must have IN_DEV (developer mode) enabled and be working on the master_skin templates to use this. Simply add the following line of code inside any template in any skin file that is being loaded on the page to see an output of the skin file itself.
{{{SHOWME}}}You will get an output of the skin file after parsing and replacements have been completed, allowing you to verify that the resulting PHP code is what you expect.











0 Comments