CSS not used

16 views
Skip to first unread message

edgarsmolow

unread,
Mar 24, 2009, 2:45:15 PM3/24/09
to pylons-discuss
CSS is used with URL:
http://localhost/logic/q01

The page is rendered as expected, with CSS. But, when the following
URL is invoked, the page is not rendered with CSS for some reason:

http://localhost/logic/q01/ABCDADF84093840384

If I understand Routes, "logic" is mapped as the controller and "q01"
as the action. In the second URL, "ABCDADF84093840384" is mapped as
the id. Why is the page NOT rendered with CSS if the id is appended
to the URL? Here's entries in Routes:

map.connect('/error/{action}', controller='error')
map.connect('/error/{action}/{id}', controller='error')

# CUSTOM ROUTES HERE

map.connect('home', '/', controller='home', action='index')
map.connect('/{controller}/{action}/{id}', controller='logic',
action='index')
map.connect('/{controller}/{action}')
map.connect('/{controller}')


Thanks.
Edgar

Piotr Kęplicz

unread,
Mar 24, 2009, 3:15:36 PM3/24/09
to pylons-...@googlegroups.com
edgarsmolow:

> CSS is used with URL:
> http://localhost/logic/q01
>
> The page is rendered as expected, with CSS. But, when the following
> URL is invoked, the page is not rendered with CSS for some reason:
>
> http://localhost/logic/q01/ABCDADF84093840384

You haven't showed the most important - CSS URL in your template. Most
probably it's relative (../css/stylesheet.css) instead of absolute
(/css/stylesheet.css).

.pk.

Wyatt Baldwin

unread,
Mar 24, 2009, 3:48:35 PM3/24/09
to pylons-discuss
Also, are you using `url('/css/style.css')`?

<link rel="stylesheet" type="text/css" href="${url('/stylesheets/
base.css')}" />

This will ensure your links work in all cases, whether you're running
your app at a prefix or not.

edgarsmolow

unread,
Mar 24, 2009, 4:48:50 PM3/24/09
to pylons-discuss
>> Also, are you using `url('/css/style.css')`?
>>
>> <link rel="stylesheet" type="text/css" href="${url('/stylesheets/base.css')}" />
>>
>> This will ensure your links work in all cases, whether you're running
>> your app at a prefix or not.

That's exactly what I was looking for. Thanks!

Edgar
Reply all
Reply to author
Forward
0 new messages