I was hoping to include a fix for this issue with v0.4 but did not get to it yet. But, for now, you can already solve this issue using the config settings that I have built into the SnS extension (don't know why I didn't think of this sooner).

To do this you edit the custom_settings.rb file in the root of the extension. In there you will find instructions and commented-out settings for the stylesheet_directory and javascript_directory (lines 24 & 25 in my latest version). Based on your example, you'd set these to:

 StylesNScripts::Config[:stylesheet_directory] = 'radiantroot/css'
 StylesNScripts::Config[:javascript_directory] = 'radiantroot/js'

Or if you want to get creative, you could:

StylesNScripts::Config[:stylesheet_directory] = 'radiantroot/assets/my-stylesheets' StylesNScripts::Config[:javascript_directory] = 'radiantroot/assets/my-javascripts'

Restart your server and everything should just work for you (unless I'm misunderstanding your request here). These settings will automatically adjust caching, rendering, and all the tags.


danny q. wrote:
Yes I am using Styles 'n Scripts,

and yes, I did notice most of this was fixed in 0.6.5, but IIRC, there
were two problems I had to address for the relative link issue.
First, with the old-fashioned script and style linking, each had to be
set explicitly in the <link> tag.  That is, I had to do <link
href="/radiantroot/..."> instead of just href="...".  That wasn't a big
deal, because it was in layouts which I only had to think about once
(but then would have had to remind myself to change before deploying and
moving to the url root). I'd hardly call this an issue with radiant. It's just how the html is supposed to work, right?

Second, the problem was a general gotcha with extensions.  Any extension
based on a path relative to / wouldn't work.  This included
styles-n-scripts, mailer, and, I think calendar.  I dug around for a
definition of a variable that would fix that, but didn't have much luck,
so decided to just go with the .htaccess hack.  It works well enough for
testing, and I definitely 'get' the whole thing about radiant not being
defined for sub-urls.

It might be interesting to see how well the root url variable definition
would work, but it looks like some of the extensions just assume it's
"/" and hard-code that way (based on my shaky RoR reading), so that
could limit the mileage a bit.

By the way, great work on both Radiant and the SnS extension.  Thank you.


Radiant mailing list
Post:   Radiant@radiantcms.org
Search: http://radiantcms.org/mailing-list/search/
Site:   http://lists.radiantcms.org/mailman/listinfo/radiant

Reply via email to