Urkonn
Urkonn

Reputation: 90

Is there a way to change the url paths in CKAN?

I want to change mysite.org/organization/someinstitution to mysite.org/institution/someinstitution

In ckan/ckan/config/routing.py the urls are defined like this:

m.connect('organization_read', '/organization/{id}', action='read')

Is there a way to change this using an extension or by any other means?, I don't want to modify the master branch.

Upvotes: 4

Views: 1328

Answers (1)

amercader
amercader

Reputation: 4540

Update: The current best way to implement custom organization types is to use ckanext-scheming, as described here. This will automatically register all the appropriate routes for you.


It is not as straight-forward as datasets with the IDatasetForm interface, but you can change the /organization URLs to /institution by changing the routing with the IRoutes interface.

Here is an example that changes /organization to /publisher:

https://github.com/IATI/ckanext-iati/blob/b26d2cd518f3991f3c3c954819a582393d9a7e35/ckanext/iati/plugins.py#L69:L103

Upvotes: 4

Related Questions