Idea: optional "search_path" setting for couchapp push

1 view
Skip to first unread message

Jason Davies

unread,
Aug 4, 2009, 11:12:02 AM8/4/09
to couc...@googlegroups.com
Hey,

Just had an idea of how to solve a problem I had a while ago: the
problem of wanting to re-use a single couchapp on multiple sites by
allowing templates, JSON settings and even views to be overridden for
each site.

A simple solution would be to add a "search_path" setting, which is an
ordered list of directories to search when pushing the couchapp. The
directories would be effectively merged before pushing. For example:

My re-usable forum application:

forum/
views/
by_slug/
map.js
lists/
index.js
templates/
default.html
settings.json

Then for my first custom site I would override the default.html
template and settings.json:

site1_forum/
templates/
default.html
settings.json

In the .couchapprc for site/ I would add the path to the forum/
directory to "search_path". Anything that is in forum/ but NOT in
site1_forum/ will also get pushed allowing site1 to override
default.html and settings.json and retain the main functionality of
the forum app.

The only thing I don't like about this is having to put a hard-coded
path into .couchapprc. Similar to Benoit's similar suggestion some
time ago, we could perhaps allow some kind of _plugins/ directory
where anything in there is merged into the main couchapp when needed.

The main point of this idea is that it allows parts of other couchapps
to be overridden, which can be quite powerful I think.

Comments welcome, I think this would be very simple to implement so I
will do it myself when I get time unless Benoit beats me to it ;-)

--
Jason Davies

www.jasondavies.com

Benoit Chesneau

unread,
Aug 5, 2009, 7:11:37 AM8/5/09
to couc...@googlegroups.com
Just to update this thread since most of the discussion was on irc, A
ticket have been open for this improvement :

http://github.com/couchapp/couchapp/issues/#issue/6

Feel free to complete it. I could work on it next weekend, so let me know asap.

- benoît

Reply all
Reply to author
Forward
0 new messages