diff --git a/docs/building_your_site/frontenddevelopers.rst b/docs/building_your_site/frontenddevelopers.rst index a3ba8eaa2..8c3ffa479 100644 --- a/docs/building_your_site/frontenddevelopers.rst +++ b/docs/building_your_site/frontenddevelopers.rst @@ -202,26 +202,31 @@ Extra attributes can be specified with the syntax ``attribute="value"``: {% image self.photo width-400 class="foo" id="bar" %} -No validation is performed on attributes add in this way by the developer. It's possible to add `src`, `width`, `height` and `alt` of your own that might conflict with those generated by the tag itself. +No validation is performed on attributes added in this way so it's possible to add `src`, `width`, `height` and `alt` of your own that might conflict with those generated by the tag itself. -**Generating the image "as"** +**Generating the image "as foo" to access individual properties ** -Wagtail can assign the image data to another object using Django's ``as`` syntax: +Wagtail can assign the image data to another variable using Django's ``as`` syntax: .. code-block:: django {% image self.photo width-400 as tmp_photo %} - {{ tmp_photo.alt }} + + +.. Note:: + The image property used for the `src` attribute is actually `image.url`, not `image.src`. + The ``attrs`` shortcut ----------------------- .. versionadded:: 0.4 -You can also use the ``attrs`` property as a shorthand to output the ``src``, ``width``, ``height`` and ``alt`` attributes in one go: +You can also use the ``attrs`` property as a shorthand to output the attributes ``src``, ``width``, ``height`` and ``alt`` in one go: .. code-block:: django