Reply to Re: dir's

Your name:

Reply:


Posted by Ognyan Bankov on 05/02/05 15:17

Dc wrote:
> hi -
>
> is there a recommended practice for setting up directory structure such
> that templates
> can be edited/viewed by designers with images and CSS sheets linking
> properly inside a
> wysiwyg editor..
> then when pages are served live the templates can live in a nice
> organised place...
>
> seems smarty thinks graphics etc are relative to the calling php file,
> not the location
> where the template actually lives.
>

the problem is not that smarty "thinks" that paths are relative to php
files.
The problem is that wysiwyg editor is not capable to understand properly
dir sctructure...
One possible solution is:
In development stage put your template dir under docroot
for examample:
/public_html/tpl/
lets say that your image dir is
/public_html/img/

that way if you define your site root as /public_html/ and image dir
/public_html/img and addres images "Site root relative" (for instance in
Macromedia Dreamweaver) wysiwyg editor will work just fine - your web
designers will be able to edit pages in "Design view".
After completing development, move /tpl dir outside docroot, change
smarty template_dir, delete cache files and release the site.
Solution is suitable for "fire and forget" type sites, but that is
rarely the case (in my case :-):-() - most of the time development is an
ongoing process.
Another solution:
Leave /tpl dir under docroot and protect it with .htaccess (Deny All
directive). That way your templates will be protected from direct
browser hit and in the same time accessible by php/smarty.
That is not very clean solution also, but it works when you have to deal
with inexperienced web designers that insist for "Design view" (damn!).

In my case - I try to teach designers not to use "Design view", but to
use cvs and their local copies of the site and preview in real browser only.

The real solution for this particular problem is: wysiwyg editors have
to mature and include settings suitable for dynamic sites.

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация