[CKAN-support] Trouble with adding a custom field but not using form.input()

Nigel Babu nigel.babu at okfn.org
Tue Mar 18 04:33:57 UTC 2014


Hey Carlos,

I somehow missed this support request. I'll get back to you today about
this.

Nigel Babu

Developer  |  @nigelbabu <https://twitter.com/nigelbabu>

The Open Knowledge Foundation <http://okfn.org/>

Empowering through Open Knowledge

http://okfn.org/  |  @okfn <http://twitter.com/OKFN>  |  OKF on
Facebook<https://www.facebook.com/OKFNetwork> |
Blog <http://blog.okfn.org/>  |  Newsletter<http://okfn.org/about/newsletter>

 CKAN | http://ckan.org/ | @CKANproject
<http://twitter.com/CKANproject> |the world’s leading open-source data
portal platform


On 11 March 2014 16:24, Carlos Quiros <cquiros at qlands.com> wrote:

>  Hi,
>
> I am adding a custom input field that is *working* with the following
> code:
>
> {{ form.input('ILRI_prjspecies', label=_('Species'), id='ILRI_prjspecies',
> placeholder=_('Cattle, Pigs, Poultry'), value=data.ILRI_prjspecies,
> error=errors.ILRI_prjspecies, classes=['control-full']) }}
>
> However I need to have the input with a spacial class and *form.input()*add the classes to the <div> and no the <input>. So I decided to write the
> input without *form.input()* like this:
>
> <div class="control-group control-small">
>     <label class="control-label" for="ILRI_prjspecies">{{ _("Species")
> }}</label>
>     <div class="controls">
>       <input type="text" id="ILRI_prjspecies" name="ILRI_prjspecies"
> placeholder="Species" class="tm-ILRI_prjspecies tm-input-success" value="{{
> data.ILRI_prjspecies }}" >
>     </div>
> </div>
>
> However is does not load or save the value.
>
> Any idea what I am doing wrong?
>
> Thanks,
> Carlos
>
> _______________________________________________
> ckan-support mailing list
> ckan-support at lists.okfn.org
> https://lists.okfn.org/mailman/listinfo/ckan-support
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.okfn.org/mailman/private/ckan-support/attachments/20140318/1aa07762/attachment-0003.html>


More information about the ckan-support mailing list