installation_instructions.md
Getting Started
-
Add 'wagtail_fedit' to your INSTALLED_APPS setting like this:
1INSTALLED_APPS = [ 2 ..., 3 'wagtail_fedit', 4]
-
Run
py ./manage.py collectstatic
. -
Run
py ./manage.py adapter_help
to see all your options and their requirements.
Click here to get more information on how to make your models editable.
Adapter help output:
Registered Adapters
====================
* The first argument is the identifier of the adapter.
* The second argument is the model and/or field to edit. instance.modelfield or instance
* Arguments prefixed with a exclamation mark are absolute. These act like flags.
* Arguments prefixed with a question mark are optional.
* Extra keyword arguments are optional; must be serializable to JSON and should not be too complex.
This is due to limits in URL-size when sharing context between views.
* You can specify 'as varname' as the last arguments to the templatetag to store the adapter HTML in a context variable.
==========
{% fedit field instance.modelfield !inline %}
This adapter is used to edit a field of a model instance.
* inline: if passed; the adapter will be rendered with inline styles.
==========
{% fedit dom-field instance.modelfield !inline %}
This adapter is used to edit a field of a model instance.
* inline: if passed; the adapter will be rendered with inline styles.
==========
{% fedit block instance.modelfield !admin !inline !movable block: blocks.Block ?block_id: str %}
This adapter is used to edit a block of a streamfield.
* admin: if passed; the adapter will add a quick- link to the Wagtail Admin for this block.
* inline: if passed; the adapter will be rendered with inline styles.
* movable: if passed; the adapter will add move buttons to the toolbar.
* block: the block instance to edit. This can be a regular block instance or a BoundBlock.
* block_id: the ID of the block to edit, required if block is not a BoundBlock.
==========
{% fedit dom-block instance.modelfield !admin !inline !movable block: blocks.Block ?block_id: str %}
This adapter is used to edit a block of a streamfield.
* admin: if passed; the adapter will add a quick- link to the Wagtail Admin for this block.
* inline: if passed; the adapter will be rendered with inline styles.
* movable: if passed; the adapter will add move buttons to the toolbar.
* block: the block instance to edit. This can be a regular block instance or a BoundBlock.
* block_id: the ID of the block to edit, required if block is not a BoundBlock.
==========
{% fedit model instance !admin !inline ?render_method: str='render_as_content' %}
This adapter is used for directly editing a model instance.
* admin: If passed; the adapter will add a quick-link to the Wagtail Admin for this model.
* inline: if passed; the adapter will be rendered with inline styles.
* render_method: The method to call on the object to render it as content. Default is 'render_as_content'.
==========
{% fedit field_bg_image instance.modelfield !preserve_svg target: str ?css_variable_name: str='background-image' ?filter_spec: str='original' %}
This adapter is used for changing a css property of a target element to a background-image.
* preserve_svg: Remove any directives that would require an SVG to be rasterised
* target: The target element to apply the background-image to - this should be a css selector.
* css_variable_name: The CSS variable name to apply the background-image to. element.style.setProperty(css_variable_name, url);
* filter_spec: The filter spec to apply to the image.