Well, the other option would be once the page is loaded to round all
elements of your page, pick the ones with a background-image and regexp them
to submission. I'd advise against this solution though, on the grounds that
:

   - it's not really simpler than adding a background-image correcting
   stylesheet
   - there'd be images flickering while loading
   - if you've got AJAX (and with CakePHP I bet you do have AJAX) you'll
   have to trigger that after every AJAX call

On the other hand, having an alternate css turning up only on this part of
the site would be really easy, you can even use it with the standard
stylesheet and only change background-image properties as long as the
targets are the same as in the standard sheet and you put the link to the
alternate stylesheet after the standard.

Michel Belleville


2009/11/16 nomen <gaston...@gmail.com>

> Hi:
>
>   Liam: My client needs to have the posibility to change itself  the
> image path and he is not a programmer, The maximun complication should
> be to change a text by another text. Anyway I know it is a posibility
> and I have it in mind.
>   Michel:  I try to use the base tag but I´m using CakePHP and it
> automatically puts in the links generathed by the HTML helper, the
> subdirectory name. So it does not work correctly with those links
> because the created links should be "www.domain.com/subdir/subdir/img/
> one.jpg <http://www.domain.com/subdir/subdir/img/%0Aone.jpg>".
>
> Thank you anyway for your help.
>
>
>
> On 16 nov, 18:03, Michel Belleville <michel.bellevi...@gmail.com>
> wrote:
> > First idea that comes to mind is to let your client define another site
> > base, you then don't even have to change your css as the apparent site
> base
> > would be the client's sub-directory.
> > You do that using the <base> tag as shown here :
> http://www.w3schools.com/TAGS/tag_base.asp
> >
> > Hope it helps.
> >
> > Michel Belleville
> >
> > 2009/11/16 nomen <gaston...@gmail.com>
> >
> > > Hi all:
> >
> > >    I have a website. All my images are in "/img" directory.
> > >    Now, my client needs to put the site in a subdirectory, so, my
> > > images are now in "/subdir/img".
> > >    In the future, maybe we have to change the site to another
> > > subdirectory.
> > >    I don´t want to change all my CSS anytime the client changes the
> > > subdirectory.
> > >    So my question is:
> > >        Is there a simple way to change all CSS background-image
> > > property with the next logic:
> >
> > >               "Change all the existing CSS background-image
> > > properties in this way:
> > >                   if the url starts with "/img" change to "/subdir/
> > > img" else do nothing"
> >
> > >   Thank you for your help in advance.
>

Reply via email to