[ckan-dev] custom fields

Fabrizio Fornari ckanappoggio at gmail.com
Wed Mar 12 14:38:37 UTC 2014


Hi guys!

I am adding some custom fields to my dataset and I am following
example_idatasetform<https://github.com/ckan/ckan/tree/release-v2.0/ckanext/example_idatasetform>,
I
tried to re-adapt it, and I can insert the new fields but the user can't
visualize them, they are not under "Additional Info" in the dataset page.

I am using convert_to_extras under _modify_package_schema and
convert_from_extras under _show_package_schema.

Shouldn't those lines (below) in
ckan/templates/package/snippets/additional_info.html show the custom fields
that I added?

 {% block extras scoped %}
        {% for extra in h.sorted_extras(pkg_dict.extras) %}
          {% set key, value = extra %}
          <tr rel="dc:relation" resource="_:extra{{ i }}">
            <th scope="row" class="dataset-label"
property="rdfs:label">{{ _(key) }}</th>
            <td class="dataset-details" property="rdf:value">{{ value }}</td>
          </tr>
        {% endfor %}
      {% endblock %}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20140312/de92652f/attachment-0002.html>


More information about the ckan-dev mailing list