1
wizanda
Adding of tpl for Smarty templates too Xoops
  • 2007/10/14 10:43

  • wizanda

  • Home away from home

  • Posts: 1585

  • Since: 2004/3/21


As tpl from what I can find, was developed by Smarty for Smarty as a template system, to define a difference between html which requires a header and tpl which doesn’t; most of my modules and development is done in tpl now, as are a few other developers on here.

So here is how to add tpl to an existing XOOPS system:
In the file class/xoopslists.php find this line:
preg_match"/(.htm|.html|.xhtml)$/i",

Add to the end of it tpl like so:
preg_match"/(.htm|.html|.xhtml|.tpl)$/i",

This will mean both tpl templates and html templates can be installed as normal and work together, if you like.

A few of the reason I have swapped to tpl:
1) No header as mentioned, which when you have many blocks each using a html file, which all think they need more weight then they do, the difference is noticeable.

2) The files are defined in your home computer for software and not a browser, though html and tpl are virtually the same other then resources used to make a template (tpl) from them. So too change and see what it looks like in a browser, you can just simply save it as html when needed.

3) They seem to be copied easier by Smarty with less disk movement (heard with my own system experimentation).

4)……….?

If you need software to edit them I recommend Weaverslave as it is free and easy to find stuff quick….plus automatically links with Top-Style Lite, which has a full CSS list and is also free…

2
kerkyra
Re: Adding of tpl for Smarty templates too Xoops
  • 2007/10/14 11:00

  • kerkyra

  • Just can't stay away

  • Posts: 553

  • Since: 2005/2/14


that looks very interesting! Perhaps it could be included in the following versions o XOOPS as well!
www.guidemap.gr - Beta is out...

3
wizanda
Re: Adding of tpl for Smarty templates too Xoops
  • 2007/10/14 11:06

  • wizanda

  • Home away from home

  • Posts: 1585

  • Since: 2004/3/21


Hopefully it will be..... its in my own current version and for us to get all these versions together, it needs odd points like this fixing in all copies....also then i can release the modules i have and not have everyone going "it doesn't work ".....
Preparation posting

4
kaotik
Re: Adding of tpl for Smarty templates too Xoops
  • 2007/10/14 13:10

  • kaotik

  • Just can't stay away

  • Posts: 861

  • Since: 2004/2/19


I can understand your reasoning, in the old days I also used tpl files with a diferent cms that also used smarty. Regarding your points against html templates:
1- XOOPS uses blank html pages as smarty templates. That means they don't have any headers.
2- The ideia behind html templates was to allow web designers to further test those templates by themselves, without even having to run them through xoops. If you think about it, it's actually a good idea, to create templates that could be self sufficient. This would provide designers with even more flexibility.
3- If an html and tpl file are exactly the same size, holding exactly the same content, smarty interprets tpl faster then html? I'm sure the good people over at smarty could anwser this.
www.kaotik.biz

5
suico
Re: Adding of tpl for Smarty templates too Xoops
  • 2007/10/14 14:36

  • suico

  • Friend of XOOPS

  • Posts: 374

  • Since: 2003/7/24


I don't know if it is faster but yes it seams logical , maybe someone from XOOPS core might have a look at it? And either explain why it is not a good idea or explain why it is a good idea and add this feature into core. (emails templates inside language already uses tpl templates instead of html templates so why not adopt this feature as an option?)

Good addition wizanda , thanks! Submit it at sourceforge maybe it will be accepted for next version.
Yogurt Social Network Service
Visit:http://www.marcellobrandao.eti.br/

Login

Who's Online

181 user(s) are online (117 user(s) are browsing Support Forums)


Members: 0


Guests: 181


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Mar 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits