# Extensions

**URL:** <https://www.ruby-forum.com/t/extensions/109096>\
**Category:** Radiant CMS\
**Created:** [July 11, 2007, 2:58pm UTC](https://www.ruby-forum.com/t/extensions/109096 "2007-07-11T14:58:41Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Keymone](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/8dc957/32.png) [@Keymone](https://www.ruby-forum.com/u/Keymone)\
**Post date:** [July 11, 2007, 2:58pm UTC](https://www.ruby-forum.com/t/extensions/109096/1 "2007-07-11T14:58:41Z")

</div>

hello

i’m looking at /admin/pages  
does anybody know what view is currently used for  
that page?

/app/view/admin/page/index.rhtml ?  
/vendor/radiant/…/index.rhtml ?  
/vendor/extension/extension[1…1000]/…/index.rhtml ?  
/radiant\_gem\_folder/…/index.rhtml ?

did somebody made translation for radiant admin part?

---

<div class="post-metadata">

**Author:** ![Keymone](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/8dc957/32.png) [@Keymone](https://www.ruby-forum.com/u/Keymone)\
**Post date:** [July 11, 2007, 9:29pm UTC](https://www.ruby-forum.com/t/extensions/109096/2 "2007-07-11T21:29:22Z")

</div>

why god damn why??  
i put all of admin views into /app/views directory and  
it does not use them…

is not it highest priority folder?

i don’t understand that ☹

---

<div class="post-metadata">

**Author:** ![Keymone](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/8dc957/32.png) [@Keymone](https://www.ruby-forum.com/u/Keymone)\
**Post date:** [July 11, 2007, 9:45pm UTC](https://www.ruby-forum.com/t/extensions/109096/3 "2007-07-11T21:45:24Z")

</div>

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!

Sean

---

<div class="post-metadata">

**Author:** ![Keymone](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/8dc957/32.png) [@Keymone](https://www.ruby-forum.com/u/Keymone)\
**Post date:** [July 11, 2007, 9:55pm UTC](https://www.ruby-forum.com/t/extensions/109096/4 "2007-07-11T21:55:26Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Keymone](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/8dc957/32.png) [@Keymone](https://www.ruby-forum.com/u/Keymone)\
**Post date:** [July 11, 2007, 10:17pm UTC](https://www.ruby-forum.com/t/extensions/109096/5 "2007-07-11T22:17:28Z")

</div>

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.

1. 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.

1. 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.

1. 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

---

<div class="post-metadata">

**Author:** ![Keymone](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/8dc957/32.png) [@Keymone](https://www.ruby-forum.com/u/Keymone)\
**Post date:** [July 11, 2007, 10:27pm UTC](https://www.ruby-forum.com/t/extensions/109096/6 "2007-07-11T22:27:29Z")

</div>

the problem is i’m trying to translate administrative part but  
i don’t know what files should i change.

this is pretty common problem - if i want something to look  
in different way it is natural to add replacement into /app/views  
folder and happily see that application is using my changes.

---

<div class="post-metadata">

**Author:** ![Keymone](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/8dc957/32.png) [@Keymone](https://www.ruby-forum.com/u/Keymone)\
**Post date:** [July 11, 2007, 11:41pm UTC](https://www.ruby-forum.com/t/extensions/109096/7 "2007-07-11T23:41:46Z")

</div>

I have actually translated about 95% of Radiant using the Gibberish  
plugin. There is a patch on the dev site, but I need to add a few  
things, then you can change the language using a yaml file. This of  
course does not address any extensions, but these are easily added.  
The main problem would be the very popular (and great) copy/move  
extension and the reorder extension. I have these both done as well,  
but have not submitted patches for them.

Email me and I will give you the latest patch. I have been meaning to  
submit a new one, but as I am swamped with work, I haven’t had time.

Once you figure out how radiant works, this is all very easy. If I am  
changing something in the core code, then I do not use the gem, but  
rather an svn checkout. The avoids one of your problems. Then as Sean  
says, be sure to check your extensions, they override everything.  
Read Sean’s post carefully and you will figure out where everything is.

Keith B.  
removed\_email\_address@domain.invalid  
Tel: +49-7731-7983830
