[Radiant] extensions
Sean Cribbs
seancribbs at gmail.com
Wed Jul 11 15:16:19 CDT 2007
It is designed in this way for several reasons.
1) Load code from the gem when possible.
We assume you'll be running in instance/project mode. This means that
the majority of the Radiant code will be loaded from one location. This
is helpful for shared hosting or multiple-site environments where the
sysadmin can install the Radiant gem and have the code shared across all
sites on the server.
2) Load code from vendor/radiant for specific installs.
Sometimes you want to have a specific version of Radiant. Maybe the
newest gem breaks your site or maybe you need a feature from the latest
codebase. This is the purpose for vendor/radiant. If it is present, it
will be used instead of the gem.
3) Let extensions override almost anything.
Extensions are designed to change the way Radiant behaves, therefore
they should have precedence over anything Radiant provides, including
views. This does not prevent them from breaking each other, however.
In the case where there's a conflict (multiple extensions defining the
same view), the lexically first extension is chosen.
4) We ignore app/views unless running in application mode.
app/views is pretty much only present when someone is developing for the
core. You might have a look at RadiantOnRails though, and the work
being done to greater integrate Radiant with other applications. They
are able to use code out of app/.
Down the road, we will have a greater compartmentalization of Radiant's
views, reducing the number of conflicts between extensions. Some work
on that was done in an experimental branch in January called facets, but
it was too 'alpha' to be included in 0.6.
So there's the overview. Maybe you could describe what specific problem
you're having?
Sean
Keymone wrote:
> thank you, yes i'm using frozen version of Radiant but still
> IMO such behaviour is very strange and unnatural...
>
> why not define priorities of directories and search for specific
> view in that order?
>
> i mean
>
> /app/views/
> is definitely much important than
> /vendor/extensions/.../views
> or
> /vendor/radiant/.../views/
>
> it could be easy solution for holding merged views for conflicting
> extensions as well
>
> On 7/11/07, Sean Cribbs <seancribbs at gmail.com> wrote:
>
>> It depends on which way you have Radiant installed for the given
>> site/project/instance.
>>
>> 1) If you checked it directly out of the repository,
>> app/views/admin/page/index.rhtml
>> 2) If you 'froze' it into vendor/radiant,
>> vendor/radiant/app/views/admin/page/index.rhtml
>> 3) If you are running from the gem,
>> ...ruby/gems/1.8/gems/radiant-0.6.x/app/views/admin/page/index.rhtml
>> 4) If you have an extension that overrides it,
>> vendor/extensions/extension_name/app/views/admin/page/index.rhtml
>>
>> I can tell you with certainty that it's most likely 2 or 3. If you
>> installed something like the reorder or copy-move extensions, it's
>> probably 4. Hope that helps!
>>
>>
>
>
More information about the Radiant
mailing list