Re: [PHP Template] Template Discussion
[email protected] (Anne Holz) Wed, 22 Mar 2000 13:01:45 -0600
| Newsgroups | php.template |
|---|---|
| Organization | ispi |
| Message-ID | <[email protected]> |
I'm a graphic designer who has been following the list from the
beginning. It sounds as though everyone is in favor of helping out the
designer but I'm afraid that most don't understand our needs. Please
don't take away the tools we need to do our work. I've put html directly
into php code, I've worked in fast templates, and I've worked in an
improved, modified, version of fast templates. I can write html but,
I'm not a programmer by any means, my talent and education are in the
design field. I'd have to say of the 3, I did NOT enjoy my experience
with fast templates. It wasn't because I thought they were too difficult
to use, it's because I didn't have the ability to make my design work
the way I intended it to. It was frustrating and time consuming. I had
more control over my design working in the php code itself. However,
since I'm not a programmer, there's a real danger of breaking something
when working directly in the php code. On the other hand, I have
enjoyed using a modified version of fast templates because it gives me
more control over my design as dictated by the dynamic nature of the
content. The new proposed template engine goes even further. It is very
much in sinc with satisfying the designers needs.
It does exactly what the other methods lack.
1) the designer can fiddle all they want without breaking anything
2) the designer can dictate how the design will be affected in each case
for dynamic content
3) the designer can preview their work, test the formatting with actual
dynamic content, and modify the design if needed.
In the beginning, we tried having the designer hand static html to the
programmer to place into their code. This was a time consuming disaster
that usually ended up in the designer settling for something less than
what they could have achieved doing it themselves.
I think there is a misconception among some on the list as to who a
designer is. To understand why a designer needs logic in a template, you
first have to understand what a designer is and what they do.
For starters, designers are control freaks. They have a keen eye for
what looks good and little tolerance for what doesn't. They come from a
print environment where they've been given the power to space two
characters apart to their liking in 1/200 EM increments or change the
color value of one pixel on their screen for an image composed of over a
million pixels.
Design is not just about what looks good. Design also involves
presenting the user with information in a way that's intelligent and
intuitive. There is a point when too much or too little information
undermines the purpose.
There is a big difference between designing static html pages and
designing for dynamic content. With static html, the only unknowns are
those that veteran designers are already familiar with such as browser
compatibility, different display resolutions, different platforms. We
take in to account all possibilities and compensate for them
compromising as little freedom as we have to in order to satisfy the
largest group of users possible.
With dynamic content, the unknowns increase. The elements that the
designer has to work with change based on logic. When the elements
change the design has to change accordingly.
Color, position, spacing, text, consistency, and images are all a part
of the design.
Example 1:
headline
<br>
tagline
<br><br>
body copy
If the tagline is empty, the example above will print as shown below:
Example:
headline
<br>
<br><br>
body copy
Now there are 3 breaks inbetween the headline and the body copy which is
way too much space for the designer to ignore in addition to the fact
that it won't be consistent on the other pages generated that have a
tagline.
In many cases, elements have to be formatted differently based on
whether or not the are displayed. It's not just whether or not a <br> is
printed to the screen. It may also mean whether or not a spacer gif
appears, a rule line, a table row, a table cell, a bgcolor, an image,
etc. All are dependent upon logic that accounts for all possibilities.
The programmer can't possibly anticipate how the designer will format
the information on the page or even which cases will require formatting changes.
In the eyes of the designer, the proposed template specs are no
different than learning a few new html tags. They will add tremendous
value to the presentation of php.
Peter Kocks wrote:
>
> Perhaps I missed something earlier, and if I did, I
> apologize, but it seems to me that the goal of providing
> template functionality is to create a mechanism by which
> non-php coders (designers) could easily put together part of
> a web page using HTML and some tags for inserting php code.
> Yes?
>
> If so, I don't see why this cannot be done with php directly
> and a simple use of here-docs. The template would be a here
> doc that gets incorporated by php wherever it needs to:
>
> Here is an example:
>
> File called designer.tmp:
>
> ---------------------------------------
> print <<< END;
>
> <HTML>
> The current date is $date <p>
>
> A table containing customers follows:<p>
> {$cust.table()}
> </HTML>
> END;
> ---------------------------------------
>
> A php program would set $date equal to the current date and
> create an object called "cust" with a method called table()
> that would print out a table listing customers. It would
> then do an include of designer.tmp. I'm not sure the
> {$cust.table()} syntax will work, but I can't see any reason
> that it should not.
>
> To make things even easier, one could create a php function
> called template(filename) that, like include, would load a
> file but it would treat it as a here doc.
>
> The only thing missing that I see is conditionals, but if
> you're going down that route, you're probably in php land
> anyway.
>
> my 3 cents worth...
>
> --pk
>
> --
> PHP Template Engine Mailing List
> Current engine specification can be found at:
> http://va.php.net/~andrei/tpl-engine-spec.txt
> To unsubscribe, e-mail: [email protected]
--
Anne Holz | [email protected]
art director | ispi
| voice: +1.402.441.3295
http://www.ispi.net | fax: +1.402.483.5418