[consulting] Challenging an Assumption About What an Easy tpl.php Looks Like

Sam Cohen sam at samcohen.com
Mon Oct 12 13:09:56 UTC 2009


Shai,

When a designer is not involved I almost always use php only versions of tpl
files, but I do find designers are much more comfortable with the mixed
technique.

As to Matt's question about Dreamweaver, the assumption is correct, you
cannot view the php only versions in "design view" where you can with the
mixed method, however, given there is no css available to the tpl files in
design view, I'm not sure designers would ever use design view, so it might
not be an issue.

What I do find a lot more readable in the mixed method is instead of all
those <?php print $terms ?> statements is the simple <?=$terms ?> but I
guess there's some good reason that method isn't used.

Sam

On Mon, Oct 12, 2009 at 8:59 AM, Shai Gluskin <shai at content2zero.com> wrote:

> Gang,
>
> Matt, very cool on the user testing.
>
> Ultimately, it does come down to personal preference. Newbies wouldn't
> know there is something different. If this is enough if an itch for me
> I could put out a Zen clone with the tpl files re-written.
>
> I want to research Michelle's suggestion that all PHP degrades
> performance. I'm sceptacle of that.
>
> Re Greg's point about the View-source less structured/ harder to read.
> First off, the output when doing it HTML style is far from perfect.
> And I think in a Firebug world, it's kind of moot, cause Firebug reads
> the DOM of the doc and puts the HTML in perfect order, so the  raw
> View-source isn't that important.
>
> An interesting addition to Matt's user test would be to ask the user
> to comment out a portion of the code, which is a really helpful thing
> to do when experimenting. Very easy in PHP; a real pain in a mixed
> PHP/HTML environment.
>
> The Zen tpl files have a bunch of helpful documentation at the top. In
> a PHP environment, the help could be interspersed throughout the file,
>  close to relevant code. It would also be easy to add sample code
> snippets that are commented out by default. Zen does that quite a bit
> in template.php and in CSS files, but that is notably missing from the
> tpl files.
>
> Shai
>
> On Monday, October 12, 2009, Nancy Wichmann <nan_wich at bellsouth.net>
> wrote:
> >
> >
> >
> >
> >
> > Shai,
> > I absolutely agree with you on the readability aspect. I, too, rewrote
> several
> > tpl.php files before I stumbled across a post on DO somewhere that said
> the
> > interspersed technique was as much as 4 times faster to execute. However,
> we
> > still see "print" used exclusively when "echo" is faster...
> >
> > Nancy E. Wichmann,
> > PMP
> > Injustice
> > anywhere is a threat to justice everywhere. -- Dr. Martin L. King,
> > Jr.
> >
> _______________________________________________
> consulting mailing list
> consulting at drupal.org
> http://lists.drupal.org/mailman/listinfo/consulting
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/consulting/attachments/20091012/d1b8c4cd/attachment.html 


More information about the consulting mailing list