[Zope] Re: ZPT rendered output formatting

Felix Ulrich-Oltean felix@chaptereight.com
27 Mar 2003 10:55:00 +0000


"Vizitiu, Ciprian" <CVizitiu@gbif.org> writes:

Ok, I'm a bit calmer now, having realised where the actual mistake
was and that it was, of course, our mistake :)

> > > > Can I have any control over how ZPT formats the html it produces? 
> > > > Specifically, source like this:
> > > 
> > > Why do you care?  A browser should not.  If you want to read the 
> > > output from time to time, and all else fails, use a pretty-printer 
> > > like Tidy.
> > 
> > Grrrr.  I *don't* really care, but it seems browsers and 
> > designers do.  E.g. when the designers put a 1px 'spacer' 
> > image in a <td> (which btw winds me up), if TAL puts the td 
> > and img on different lines, IE formats the td as thought 
> > there is something in it.

To be fair to ZPT, I've just realised that my statement above is not
correct - it does not insert \n between elements.  THe only thing it
does is sometimes split up the tag itself when it has dynamic
attributes, e.g.

<img tal:attributes="src z/b/c" width="20" height="50">

gets rendered as

<img width="20" height="50"
     src="http://z/b/c">

which is fine.

> > More generally, the designers are getting annoyed that the 
> > formatting of their markup is not being preserved.
> 
> Well... It's not really the designer but the HTML coder that gets annoyed.
> Most of the times it is the same person... 

Yes - that's the case here.

> > I wish I had the time and energy to convince people not to 
> > use dozens of tables filled with 1px images, but I don't.
> 
> Do you honestly think that html-coders/designers enjoy the "universal" 1px
> hack? Why convince the page designers? :-o Try the people that design the
> standards... And the rendering engines in browsers!

I think we (my company) also need to move away from the 'must look
good in back browsers' where look good means 'the same'.  We're starting
to get there with our html/css - i.e. coding to standards, not
browsers, but there's a long way to go, not least in educating the
clients.

> Anyway, for various reasons we need some control over how we get the html
> formatted.

It would just be nice for it to be predictable at least, but I think I
was just plain mistaken before, so I'm not as concerned now :)

Felix.