PDA

View Full Version : How to customize templates?


Anonymous
06-09-2005, 08:58 PM
This new version 2.0 rc2 has a different setup than version 1.012 in regards to the templates. They now seems to be in [root_folder]/templates with filenames of header.tpl, footer.tpl, main.tpl, etc. They are also a mix of HTML and PHP instead of the version 1.012 HTML templates.

Is there an easier way for us to customize the "look&feel" of the templates to match our website theme? I am stronger in a visual-mode (Dreamweaver) than in PHP code (BBEdit), so looking at the new templates is a bit intimidating.

What I'd like to be able to do is throw all of the code into a table perhaps 500 pixels wide so that we have some control of its width and placement. I did it with main.tpl amd link.tpl but all of the other page content is 100% window width and harder to find.

Thanks again for a great looking, now-matured script. I'll donate!

kwirl
06-09-2005, 09:01 PM
Exporting the directory page into a table on an existing page is something I am trying myself to do :P

Let me know if you make any progress with this, I'll do the same!

dcb
06-09-2005, 11:04 PM
V2 is written using the Smarty (http://www.smarty.net/) template engine, which is probably the best PHP template engine.
The templates are now stored in the /templates folder. The main directory template is main.tpl. From this template all the others are included, just to keep things a bit cleaner: header.tpl, top_bar.tpl, link.tpl, pagerank.tpl and footer.tpl. I think their names are self explanatory. Also inside the templates you'll find a few comments (enclosed in {* *}).
I must admin, though, that at a first look the code might look scary, but there is a lot of logic into the interface mostly due to the fact that almost everything can be switched on or off.

PS: For those of you using Dreamweaver there is a Smarty Dreamweaver Tags Extension (http://www.download.com/Smarty-Dreamweaver-Tags-Extension/3000-2352_4-10393552.html) which might be helpfull.

dcb
06-10-2005, 12:30 AM
Well, after reading your posts I tested the template with a 500px table and everything resizes fine. Just put your template HTML code in header.tpl and footer.tpl and you are good to go.

I added this in header.tpl
<body>

<table width="500" border="0">
</tr><td>
<h1 id="title">{$in_page_title}</h1>

and this in footer.tpl

{/strip}
</td></tr></table>
</body>

and I got a 500 pixels wide directory in a table cell

Anonymous
06-10-2005, 11:40 AM
Guys, just 1 silly question - in the .css file, which entries control the colour of the category headings/links on each page? I want to change the default Blue and Purple entries and I cannot for the life of me work out which style I need to change - I think I've tried everything!

Cheers
James

Duilen
06-10-2005, 11:50 AM
Make a new class in css for the colors.

Maybe something like this...
Content visible to registered users only.

Then go into main.tpl and find the link you would like to change color. It should start with <a href...
Change it to <a class="head" href...

I have just done the same thing on my site so I know it works. If you need more help send me a PM.

Duilen
06-10-2005, 11:53 AM
You could also do it without the class if you want all the links to be the same color. That would look something like this.

Content visible to registered users only.

Anonymous
06-10-2005, 11:57 AM
Thanks - I knew I was missing something somewhere.....

I want the main categories to be one colour, and the sub categories to be another.... shouldn't be too hard - I guess I didn't think of it because I thought the entries must already be in main.css somewhere!!