[ckan-dev] redirect homepage (like on data.gov)
Reinier Battenberg
reinier.battenberg at mountbatten.net
Tue Mar 4 07:20:04 UTC 2014
That looks like I might be able to do. Its in my todo queue. Thanks!
On Monday 03 March 2014 17:19:11 Vitor Baptista wrote:
Hi Reinier,
I did this for the Mexican instance. Check in https://github.com/okfn/ckanext-
mx/commit/8c89f696412da618ca1ddea6a04eaad25d5a1e7d.
Basically, you need to implement plugins.IRoutes in your theme (or any other
plugin), and do:
def before_map(self, m):
m.redirect('/', '/dataset')
return m
Cheers,
2014-02-20 15:36 GMT-03:00 Reinier Battenberg
<reinier.battenberg at mountbatten.net>:
Hi,
I would like to redirect our homepage to /dataset, like http://data.gov
redirects to /dataset
I tried a few tricks on theme level but i cant figure out/google the 3 lines of
code that can do the trick.
(i checked their extentions here: https://github.com/ckan/ckan/tree/release-
datagov/ckanext but none of them says: ckanext-redirecthehomepage, i also
searched the full repo on redirect, so i figured, somewhere I have to do either
(in pylons)
redirect_to(controller='packages', action='dataset', _code=301) }}
in pure python:
map.redirect('/packages', '/dataset')
I think that is where my python/ckan knowledge ends. (for now)
Anyone can give me a quick pointer?
--
rgds,
Reinier Battenberg
Director
Mountbatten Ltd.
www.mountbatten.net
tel: +256 758 801749
twitter: @batje
_______________________________________________
ckan-dev mailing list
ckan-dev at lists.okfn.org
https://lists.okfn.org/mailman/listinfo/ckan-dev
Unsubscribe: https://lists.okfn.org/mailman/options/ckan-dev
--
Vítor Baptista
Developer | http://vitorbaptista.com | LinkedIn | @vitorbaptista
The Open Knowledge Foundation
Empowering through Open Knowledge
http://okfn.org/ | @okfn | OKF on Facebook | Blog | Newsletter
--
rgds,
Reinier Battenberg
Director
Mountbatten Ltd.
www.mountbatten.net
tel: +256 758 801749
twitter: @batje
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20140304/4d38326a/attachment-0003.html>
More information about the ckan-dev
mailing list