1

Topic: Handy Tip: Working out which template is being used.

WARNING: To start with, this method will corrupt the layout of your site if you or your users are using IE. To get around this, make a copy of YOURTEMPLATE and call it Testing. Upload Testing to your site so that you now have http://www.MYDOMAIN.com/templates/Testing.... Now enable Testing in the CP (Settings, Templates). You should also force users to use your default template so that they cannot see "Testing" (Settings, System Settings, Look and Feel)

Now comes the tedious part... using your editor eg Notepad++, open every template in Testing and at the very top add the following:

<!-- BEGIN DEBUG template.name.tpl-->

where template.name is the actual name of the template. NOTE: There is no space between tpl and --> It is Very NB that it is .tpl--> with no spaces.
At the very bottom, add the following:

<!-- END DEBUG template.name.tpl-->

again, no spaces.

Now upload Testing to your server.

As an example, you might want to change the details shown in a guestbook entry. So, using Google Chrome, open your site to the page you want the changes to be made ie where there is a guestbook entry. Now press crtl+shift+i and the screen will split as below:
http://www.desperatesailors.com/media/vld.JPG

Expand the code until you find the part that you are looking for - eg the guest book entry. Note in this example that the <-- BEGIN DEBUG ext.guestbooks.tpl--> shows above the line of code that is hi-lighted and on my website, the guestbook entry is also hi-lighted in blue. Now I know that it is the ext.guestbook.tpl that I need to edit.

Go on, try it on a few different pages, which will also show you how all the templates brilliantly fit together! Well done Vlad.

Edit the template in Testing, check your changes, then make the same changes to your default template.

Hope this will help you all.

2

Re: Handy Tip: Working out which template is being used.

One other thing, in ./templates/testing/media I have changed the background colour in site.css (line 10) so that I know that I am working on the Testing template and not the default one.

Last edited by DesperateSailors (2011-08-14 10:21:17)