Best way of moving HTML from core to skins is

30.8% 8
11.5% 3
53.8% 14
3.8% 1

26 Date 2009-09-09 01:20

Forums / Cotonti / Core Labs / Archive / Poll: Wiping HTML out from core

Discussing ways

Trustmaster
#16914 2009-09-09 01:20
This has been discussed many times here and there. I've encountered this problem once more with a PNG skin and would like to solve this problem at least as experiment. However, we have to decide what to do about HTML still-in-the-core in future (0.7 and up).

Assign many TPL tags and use TPL logic everywhere

Means putting all the HTML directly to those places they appear in templates. Define HTML in templates and assign tags for attributes and contents.

Pros: very pure Model-View-Controller (MVC) design, everything of layout is in the templates.
Cons: tens and hundreds of new {TPL_TAGS} to emerge.

Use spans + CSS for icons, leave the rest alone

Is described and discussed here

Pros: neat CSS for icons
Cons: may result in massive non-semantic markup, doesn't solve problem for everything except icons

Assign as PHP strings in skin_name.php

We could follow the footsteps of language files. The main goal for moving HTML from core to skins is to let the skin makers total control over markup and layout, including small details. But there are hundreds of such pieces and most of them contain HTML mixed with PHP code, so it is very hard to organize. Putting them to PHP strings e.g. $S in skin_name/skin_name.php would let skin makers customize those HTML snippets and keep the flexibility of PHP code.

There should be a default file with resource strings that comes with the core and provides all the necessary strings which will suit many (existing) skins out of the box. And any of those strings can be overwritten in skin_name.php, so you can customize only those strings you need and everything is standardized.

Pros: hit 2 birds with one stone, possible backwards compatibility
Cons: not pure

Questions/suggestions are welcomed.
May the Source be with you!
This post was edited by Trustmaster (2009-09-12 15:40, 14 years ago)