> > and on top of that I want people to be able to edit
> > templates easily in dreamweaver, frontpage, etc
> > and send templates thru
> > HTML tidy to be able to always output valid XHTML.
> 
> If you are an OO-advocate, you would hide the presentation format in
> objects, e.g. Table, String, and Link.  This ensures the output is
> valid through the (re)use of independently tested objects.  Objects
> also provide a mechanism for overriding behavior.

Well, there is an interesting example on this page:

<input type="text" name="username" size="25">

And the question which is raised is: "How does the graphic designer know
that the display size of a username is 25?".

Here is what you'd write with Petal:

<input type="text" name="username" size="25"
       petal:attributes="size user.login_preferred_length;
                         maxsize user.login_maxlength" />

Then no matter what, the display size of a username would be OK. And the
graphic designer could still move this tag around or change the 'size'
attribute. Better, you could do the following:

<span style="border-style:solid; border-color: blue"
      petal:attributes="style default_style">

  <input type="text" name="username" size="25"
         petal:attributes="size user.login_preferred_length;
                           maxsize user.login_maxlength" />

</span>

And then the dynamic component would have a blue border when it is
edited (so that the graphic designers knows that this bit of the page is
subject to change) but which would be set to default_style when the page
is processed...

I find it really really horrible to mix HTML and Perl code. So let's say
that some different kind of HTML is needed, it means that I have to
create a new object, subclass an existing widget, etc...

With a templating system, this can all be done by someone who has
knowledge of HTML. Better, with Petal, all the presentational stuff can
be done with a WYSIWYG editor a la frontpage. No need to go and tweak
some strange declarative language.

Actually I don't think these two things are incompatible. After all you
could have 'independently tested objects' which would themselves use
templates... Then you could organize your templates into two kinds:

'system / admin' templates which are related to the 'web application',
you the programmer, would be in charge of maintaining these templates.

'presentational' templates which would just delegate method calls to
your template driven widget library. You'd give these templates for your
graphic designers to play with...


> And here is the HTML-less source:
> http://petshop.bivio.biz/src?s=View.items

Well, sorry, I find it really, really horrible :-)

For example:

image => 'add_to_cart',
field => 'add_to_cart',
alt => 'Add Item to Your Shopping Cart',

or:

cellpadding => 2,
cellspacing => 2,

You are definitely tying your objects with HTML. 'cellpadding' or 'alt'
are _definitely_ HTML-specific, and I don't see why they should be
polluting your business logic.

I see that all the code which you output is html 4.0 transitional. What
if you want to make everything XHTML 1.1 strict? Or if you want to get
rid of all the 'font face' tags?

You want to rewrite all your widget library? Wouldn't it be easier to
have templates which you can send through some kind of HTML fixed /
validator such as tidy?


> Apologies to those who are tired of the *ML vs. Perl debate.

Well, as long as we don't start trolling and that we agree to disagree
we'll be fine :-)

Best regards,
-- 
IT'S TIME FOR A DIFFERENT KIND OF WEB
================================================================
  Jean-Michel Hiver - Software Director
  [EMAIL PROTECTED]
  +44 (0)114 255 8097
================================================================
                                      VISIT HTTP://WWW.MKDOC.COM

Reply via email to