[consulting] Challenging an Assumption About What an Easy tpl.php Looks Like
Matt Chapman
Matt at NinjitsuWeb.com
Mon Oct 12 03:28:59 UTC 2009
Is there a difference between the two as to whether the file can be
loaded and safely edited in Dreamweaver in WYSIWYG mode? (I don't use
DW, but I know many (/most?) designers do.)
Also, I showed these to my wife, who can read & edit basic HTML, but not
PHP. I asked her if she'd be comfortable with moving the taxonomy terms
to display after the node contents. First seeing the PHP version, she
did not think she could safely do it. Then seeing the original, she
immediately point to the correct block of three lines, and said she'd
copy and past them to line 71. Perfect.
An unscientific test for sure, but I'd definitely side with the
traditional form.
Best,
Matt
Shai Gluskin wrote:
> Gang,
>
> Every tpl.php file that I've seen in any theme is written in html with
> php interspersed for putting in variables. I think part of the
> reasoning for this approach is that it would be easier for non-geek
> designers to read such pages.
>
> I want to challenge that. I think all those php open-close and all the
> "print" commands makes for very hard-to-read code. Tonight, as an
> experiment, I rewrote the node.tpl.php file from Zen from html to php.
> I think it is a lot easier to read. And it's sure a lot easier to comment.
>
> I pasted my rewritten version and the original from Zen onto a pastebin:
> http://pastebin.ca/1614186
>
> Anyway, I'd be curious what other's opinions are on this.
>
> best,
>
> Shai
> ------------------------------------------------------------------------
>
> _______________________________________________
> consulting mailing list
> consulting at drupal.org
> http://lists.drupal.org/mailman/listinfo/consulting
>
More information about the consulting
mailing list