An alternate way of controlling presentation templates.

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
User avatar
Heavy
Forum Contributor
Posts: 478
Joined: Sun Sep 22, 2002 7:36 am
Location: Viksjöfors, Hälsingland, Sweden
Contact:

An alternate way of controlling presentation templates.

Post by Heavy »

This is about control elements/tags when templating presentation and related to this discussion.
Is it OK to include control structures in a custom parameter of HTML or XML tags?
example:

Code: Select all

<div tplifset="varname1">
    Tjohooo!
    <div tplloop="varname1 as varname2">&#123;$varname2&#125;</div>
</div>
I browsed the w3c HTML4 specification with no succes finding whether unrecognised element parameters should be ignored by a user agent or not.
I thought this up after reading this:
jason wrote:However, a bigger problem (and the same one Smarty suffers from, is the variable printing problem.

Code: Select all

<&#1111;VAR name]>
tells me that it will print a var named name. But this is not good, because when I put this into a template, and then try to view the template, I won't see a thing. So I can visually style my document. {header} would be better here for variables that would be displayed. That way, I can see, visually, the style as I am creating the template.

Simply, XML based templates, or those that try to act like them, are bad for designers. Designers don't design using XML, they design visually. Programming create these templating engines with the thought of what THEY think designers need.
In most wysiwyg editors (I don't use any), you can set parameters to elements manually.

By doing this I introduce at least one new problem:
When skimming through the template code it is harder to see these template controlling element parameters than when they are written out as dedicated comment tags <!-- like this-->.

The good thing, unless someone finds reasons why this is really the wrong way to go, is that it is available from within the wysiwyg editor, without switching to HTML mode.

If it IS a problem, one could just allow standalone control elements aswell. Then, it is up to the designer which way he/she prefers to go.
Post Reply