RE: [SMARTY] Paths in templates
| From: | SavaJr | Date: | Mon, 03 Feb 2003 22:53:38 +0000 |
| Subject: | RE: [SMARTY] Paths in templates | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-7501@lists.php.net to get a copy of this message | ||
Such technics still up to developer and hiw situation.
I just created auto-thumbnailer in conjunction with some third-party
class - like {image src=some_path.jpg height=100 width=150}
And it creates thumbnails to fit that area, also seems like class
capable of some production, so this should be good technics for
near-dynamic images - like some user galleries or so.
This is just my current situation.
In сase if work is shared with designer and no need for dynamic images
symlinks works much better - easier for designer etc.
---------------
Ruslan Savchyshyn
http://www.MagneticOne.com/
Web development and design services
-----Original Message-----
From: gawan [mailto:mail@gawan.net]
Sent: Tuesday, February 04, 2003 12:52 AM
To: Smarty General
Subject: Re: [SMARTY] Paths in templates
Should these matters eventually be good to be
included and explained in the docs some day?
gawan
----- Original Message -----
From: "Monte Ohrt" <monte@ispi.net>
To: <savajr@avalon.te.ua>
Cc: "Smarty General" <smarty-general@lists.php.net>
Sent: Monday, February 03, 2003 8:00 PM
Subject: RE: [SMARTY] Paths in templates
> Another method is to use a template function:
>
> {image name="myimage.jpg"}
>
> this will get compiled into:
>
> <img src="/images/myimage.jpg">
>
> or:
>
> <img src="/development/images/myimage.jpg">
>
> The application figures out the image path depending on
> development/production environment, but the templates look the same in
> both.
>
> Monte
>
> On Mon, 2003-02-03 at 11:04, SavaJr wrote:
> > Hello Ferdinand
> >
> > Absolutely agree with you regarding the development practices on URI
> > and local fylesystem PATH etc.
> >
> > The main disadvantage of smarty templates for designer is that he
> > doesn't see the graphics while working in subdirs or should copy
> > file each time into root dir (or change their paths like ../ or so)
> >
> > The solution for development time is creating symlinks from smarty
> > templates dir.
> >
> > The filesystem structure is:
> >
> > ROOT
> > ------
> > Img
> > Css
> > Templates
> > |----img -> ../img
> > |----css -> ../css
> > |----template.html will look same in root and template dir.
> > Some_dir
> >
> > Script.php
> >
> > Another advantage is that we don't need things like
> > <a href="{$URIs.root}"><img src="{$URIs.images}home.gif"
> > /></a>
> > Simple <base> tag makes things, even say more - it is not required
> > at all.
> >
> > ---------------
> > Ruslan Savchyshyn
> > http://www.MagneticOne.com/
> > Web development and design services
> >
> >
> > -----Original Message-----
> > From: Ferdinand Beyer [mailto:fbeyer@clickhand.de]
> > Sent: Monday, February 03, 2003 6:37 PM
> > To: savajr@avalon.te.ua
> > Cc: smarty-general@lists.php.net
> > Subject: RE: [SMARTY] Paths in templates
> >
> >
> > On 3 Feb 2003 at 17:41, SavaJr wrote:
> >
> > > On unix you can also make symlinks in templates dir, to original
> > > dirs.
> >
> > > Like
> > >
> > > Templates
> > > - img -> ../img/
> > >
> > > It helps while developing
> >
> > Im my experience it is the best practice to use absolute uris like
> > /images or /index.php. I usually define a constant with the ROOT_URI
> > during development so that my apps can be run in a sub directory -
> > e.g. /projects/xyz/. In production I simply set this ROOT_URI to /.
> >
> > For Smarty I assign an array with uris for important directorys like
> > the
> >
> > root or the images directory:
> >
> > <a href="{$URIs.root}"><img src="{$URIs.images}home.gif"
> > /></a>
> >
> > HTH
> >
> > --
> > Ferdinand Beyer
> > <fbeyer@clickhand.de>
> >
> >
> > --
> > Smarty General Mailing List (http://smarty.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> --
> Monte Ohrt <monte@ispi.net>
>
>
> --
> Smarty General Mailing List (http://smarty.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
Smarty General Mailing List (http://smarty.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php