Skip to content

Commit

Permalink
Merge pull request #4718 from pdelboca/docs-add-resource-form-to-addi…
Browse files Browse the repository at this point in the history
…ng-custom-fields

Docs: Complete extending guide with reference to resource_form.html snippet.
  • Loading branch information
amercader committed Apr 9, 2019
2 parents ebe9d83 + 78637de commit 039b8e6
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 039b8e6

Please sign in to comment.