Skip to main content Help Control Panel

Login   A+   A-

Community «   Discussion forum «   Post your requirements here «  

Templating of all html output.

avatarRhodes, Nick -- on Oct. 11 2007, from West Yorkshire, UK
YACS team (UK)
Hi,

I came up with the idea to make items like the privacy and about pages editable (make them articles) and I have now come up with the idea of making ALL html output as templates.

My idea is to store them with relative skins in subfolders, so the html for viewing an article would be in skin/articles/view.php.

Idea is that if you want to add a feedburner link next to netvibes or newsgator link, or change the way "Permalink · comment · Discuss · Trackback" links look this can be done by editing the skin files, rather than the source. The php code will not have to be touched, which will maintain upgradability.

One consideration is maintaining compatibility with configuration options that affect how content is displayed in sections (eg blog or wiki format). Maybe we could have the ability to create our own custom ones ?

Bernard has suggested utilising the overlay infrastructure, what does everyone else think ?
Bernard
avatar
from nearby-an-airport
Associate, 6745 posts

on Oct. 12 2007


Nick, a first step that would probably help a lot would be to allow for the loading of template.html instead of the existing template.php. At least, it is easier for skin designers to generate some HTML page, and then to integrate some PHP statements in it.

Also, which language would you use for your generalized templates? I mean, if you want to have some "clever" templates you need some programming language, correct?
NickR
avatar
from West Yorkshire, UK
332 posts

on Oct. 15 2007


IMHO we should try and use we already have, we could use php (in a simlar manner to how skins are now, but far more detailled). There is the option of creating our own XML based system (like xaraya or even asp.net does), or use a templating engine like smarty.

Things to consider are compatability with our i18n efforts and also the cache, performance implications as well.

Will take some time to go through the options, but if anyone has any ideas or suggests to help, let me know, as I am spending a bit of time researching the subject.

For starters I have found this very useful link: http://www.phpwact.org/pattern/template_view

and another (advocates using php itself, which I agree with) http://www.massassi.com/php/articles/template_engines/

Nick.
Bernard
avatar
from nearby-an-airport
Associate, 6745 posts

inspired from NickR on Oct. 15 2007


NickR: At the moment YACS strictly adheres to the principle of using PHP as the only language used on server side, including for skin templates. My understanding is that this is a strength of the softwareon the long run.
NickR
avatar
from West Yorkshire, UK
332 posts

inspired from Bernard on Oct. 17 2007


" NickR: At the moment YACS strictly adheres to the principle of using PHP as the only language used on server side, including for skin templates. My understanding is that this is a strength of the softwareon the long run.

"


I agree with that.

Further thought, a clarification, is that we do not need to template ALL output structures, eg the heading - uses a h1 tag, why should that every need to be changed ?

What I as thinking is having lots of editable regions, eg above-title, below-title where skin developers can insert their owen template code (maybe a graphic for example).

Cheers Nick.
-----
Nick

Rate this page
Posted by NickR on Oct. 11 2007, commented by NickR on Oct. 17 2007, (popular)