Hey Chris,

That is pretty much what I was looking for before I used apache rules to
do it.  I really can't say how big a problem it is because I don't know
how many people need to run production radiant on non-root urls, and I
don't know how many of them are as green and part-time as me, and
wouldn't be able to tweak the source a bit on their own to do it.

There might be a benefit to having something like what you describe (one
line of code commented out by default) in the environment.rb for the
whole radiant install and its extensions, but I don't know how much
cat-herding would be involved in getting that implemented and getting
all the extension code to work with it.

Nonetheless, thanks for the clarification on that.  I didn't know about
the custom_settings.rb, so that little bit of information should come in
handy sooner or later.

--danny


Chris Parrish wrote:
> Danny,
>
> 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.
>
> -Chris
>
> 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.
>>
>> --danny
>>
>>   
> _______________________________________________
> Radiant mailing list
> Post:   Radiant@radiantcms.org
> Search: http://radiantcms.org/mailing-list/search/
> Site:   http://lists.radiantcms.org/mailman/listinfo/radiant

_______________________________________________
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