Roman:

We try to leave everything we get from design as close as possible to the way they gave it to us. We laid down some ground rules for design, everything their html uses must be put in flash, images, css, js, and fonts directories. I have also gotten them into designing layouts and views, so I no longer have to split them up for my framework. I then implement a pre-filter which will allow me to dictate the location in my system so I can basically put the resources anywhere I want.

What this ends up doing:

  1. You no longer have to go into every template and edit it as much,
     and allows you to focus on the presentation logic more.
  2. Also it kind of forces the designer to think about where to put
     things, because we were getting javascript libraries laying around
     -- outside of the js directory for no reason at all.
  3. It allows you to implement different skins for your site easily.
  4. Also now design can download the html and work on it, the source
     still has "images/, "css/, "js/, so their design software will
     still work, and show the images.
  5. And you don't have the problem of forgetting to remove stuff for
     production.

I hope this has helped you out.

Best regards,
Levi Stanley

On 11/03/11 04:00, romtek wrote:
Hi,

The nature of the development approach that I use is that paths to resources (images, CSS and JS files, etc.) relative to the template files during design time are different from those during run time. (I have templates in a separate folder, but my web app runs as index.php in the root folder.)

I like to see preview of a page I work on in Design view of Expression Web or Dreamweaver, and so in order to have images, etc. point to proper paths during design time and also during run time, I do something like this in my templates:

<img tal:attributes="src string:${resourcesDir}/shared/images/menu_bar.jpg" src="../../resources/shared/images/menu_bar.jpg" />

This increases workload, makes code less readable, and is error prone during modifications.

How do you, guys, deal with this issue, if you do? Maybe there's a trick that I haven't thought of. I've tried using <base> element, but Dreamweaver ignores it, and Expression Web messes up my code. By the way, this problem isn't limited to those who use PHPTAL but, apparently, is also shared by some of those who Code Igniter (and, I am sure, other frameworks that require a structure of folders): http://codeigniter.com/forums/viewthread/94591/#478998

Roman


_______________________________________________
PHPTAL mailing list
PHPTAL@lists.motion-twin.com
http://lists.motion-twin.com/mailman/listinfo/phptal

_______________________________________________
PHPTAL mailing list
PHPTAL@lists.motion-twin.com
http://lists.motion-twin.com/mailman/listinfo/phptal

Reply via email to