I use jQuery in my projects as well and I have a base template that
all my other templates inherit from in Mako that has a base path
defined.  I also use definitions to setup all of the html structure
for including my css and javascript files.  However, that doesn't help
with images that are defined in the css files if they are hardcoded.
I have to say that almost all of the jQuery plugins, including UI,
that I have used have relative paths defined in the CSS.

I like to have all my images in one location and used to put all of
the jQuery images in my images directory, but that is impractical so I
just make sure that when I install a plugin it goes under my
javascript/jquery directory exactly like the author defined.

- Eric

On Jan 7, 4:03 pm, DD <[email protected]> wrote:
> You can rewrite the URL in routing.py:
>
> map.redirect('/plant/tool/verify/img/{fname}.png',
> '/tool/verify/img/{fname}.png')
>
> DD.
>
> On 1/7/2010 1:54 PM, writeson wrote:> Hi all,
>
> > I'm a pretty new user of Pylons and I've got a question about using
> > jQuery/jQueryUI with Pylons. When I'm developing on my local machine
> > and accessing static files in the public directory things work fine.
> > But when I post this to our production server there is a problem
> > accessing images that are embedded in jQuery and jQuery css files
> > (background-mage : url(/images/thing.png);). This is because my local
> > development path is something like this:
>
> > /tool/verify
>
> > where as in production:
>
> > /plant/tool/verify
>
> > This breaks the hard coded image paths that are in the jQuery UI css
> > files (and in some of my Javascript files that are trying to use
> > images). In my Python files I can use h.url_for() function to great
> > the correct relative mapping. But I can't call this function from
> > Javascript, and there is nothing that would do this kind of work
> > inside of css files. Is there a way to handle this so I don't have to
> > edit the paths inside css files for every installation?
>
> > Thanks in advance for your help!
> > Doug
-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en.


Reply via email to