Documentation

Features

Differences

This shows you the differences between the selected revision and the current version of the page.

templates:guide 2008/08/26 09:47 templates:guide 2008/08/26 09:56 current
Line 9: Line 9:
  * /templates/   * /templates/
 +    * bluenew/
    * default/     * default/
-      * bluenew/ 
The only required files for your layout are layout.tpl and a stylesheet file. The only required files for your layout are layout.tpl and a stylesheet file.
 +
 +===== Creating a new template =====
 +When creating a new template you should first create a new folder inside the "templates" directory.
 +
 +The majority of the layout is handled through two files and they are layout.tpl and style.css so you would take these two files and add them to your new folder.
 +
 +Now you can upload this folder and these files then change your template in administration -> main settings and you will have a new look to your website.
 +
 +If you look at your site and see another page you would like to modify but are unsure which template file it is you can add <code>{debug}</code> to the layout.tpl file.  Then visit the page again and a pop up will appear giving you information about the template files in use as well as a list of all the variables available for the page.
 +
 +Once you get the file name you can then copy that file out of the default template folder and move it into your new folder.
 +
 +68 Classifieds works by using two template paths. The one you have defined and the default template folder. So if it can't find a file in your template folder it will use the default. **Please Note:** This only applies to .tpl files. Images and/or other files will not be picked up unless specifically referenced.
 +
 +** Reference **
 +  * [[http://www.68classifieds.com/forums/showthread.php?t=4559|Modifying the default template in v4 pdf guide]].
 +  * [[http://smarty.net/crashcourse.php|Smarty Crash Course]]
 +
 +===== Conditional Tags =====
 +The Conditional Tags can be used in your Template files to change what content is displayed and how that content is displayed on a particular page depending on what conditions that page matches. For example, you might want to welcome a logged in site visitor with a nice friendly greeting.
 +
 +<code>if $smarty.session.username<>""} Welcome back {$smarty.session.username} {/if}</code>
 +
 +That may look pretty complex but actually it is very simple once you get your head around. The first portion ''{if $smarty.session.username<>""}'' checks to make sure they are logged in and their username is not blank. Next the welcome back portion just prints their name if the first condition is true.
 +
 +** Reference **
 +  * [[http://www.68classifieds.com/blog/stepping-into-smarty-conditionals/|Stepping into Smarty Conditionals]]
 +

Have more questions? Visit our community forums.