Skip to content

Commit

Permalink
Complete extending guide with reference to resource_form.html snippet.
Browse files Browse the repository at this point in the history
  • Loading branch information
pdelboca committed Apr 5, 2019
1 parent b28d79c commit 78637de
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions doc/extensions/adding-custom-fields.rst
Expand Up @@ -405,6 +405,13 @@ similarly
:pyobject: ExampleIDatasetFormPlugin.show_package_schema
:emphasize-lines: 20-23

Add the code below to ``package/snippets/resource_form.html``

.. literalinclude:: ../../ckanext/example_idatasetform/templates/package/snippets/resource_form.html
:language: jinja

This adds our custom_resource_text to the editing form of the resources.

Save and reload your development server CKAN will take any additional keys from
the resource schema and save them the its extras field. The templates will
automatically check this field and display them in the resource_read page.
Expand Down

0 comments on commit 78637de

Please sign in to comment.