[ckan-dev] Customising the dataset form in 2.0

Sean Hammond sean.hammond at okfn.org
Thu Feb 14 12:06:38 UTC 2013


> > > Currently this is by design to keep the snippets clean.  The reason is so
> > > that snippets can be included in any templates and are passed the
> > required
> > > data which may be in a different variable in different pages.  If we
> > pass c
> > > then we will end up with people creating snippets that are not reusable.
> > >
> > > As to the best solution,  I'm not sure.  I think that part of the problem
> > > here is the depth of the calls template -> snippet -> snippet -> snippet.
> > > It would be nicer if this was a bit simpler but I understand why it has
> > > been done this way.  I'd also be happy with something like
> > > c.snippet_context which would appear as c in snippets but that might be
> > > even more confusing.
> >
> > I think there should be an easy way for people to add their own custom
> > fields to the dataset form, really they should just have to override one
> > file or block and add in their own code. Maybe we should add a snippet
> > that's empty by default but that gets passed the necessary values, just
> > for people using IDatasetForm to override?
> >
> > This would be nice to have a solution to.  At the moment i am not in the
> best position to think about the solution but we do want to get this done
> for 2.0 IMHO as after that is released we are stuck as far as changing
> behaviours etc if we want a stable ckan.
> 
> A most horrible idea would be to have a form like c.form in the controller
> c.form_extras that would use it's own template.  but really I hate the
> c.form approach so maybe there is another solution.  Maybe we should have a
> dev meeting at some point to look at issues like this.  I'm not sure what
> our current communication channels to resolve issues like this are now.
> the standups are now no longer a place for this sort of discussion do we
> have a place now?
> 
> hmm, let us keep this issue live for a bit

Just to say that the example_idatasetform plugin on this branch:

https://github.com/okfn/ckan/pull/295

is currently working with CKAN 2.0 master, so that shows what you
currently have to do to override the templates.

I've been working on various IDatasetForm fixes this week and hopefully
for a few days next sprint but I don't think I'll have time to fit in
this templating improvement as well, see:

https://github.com/okfn/ckan/pull/383
https://github.com/okfn/ckan/pull/377
https://github.com/okfn/ckan/pull/295
https://github.com/okfn/ckan/issues?labels=idatasetform&page=1

That last link is not a complete list of the issues btw!

And there is still IGroupForm and IOrganizationForm to do...




More information about the ckan-dev mailing list