Image map functionality for Wagtail through inline SVGs
wagtail_svgmap
to your INSTALLED_APPS
wagtail_svgmap.blocks.ImageMapBlock()
to a StreamField
in your page classWAGTAIL_SVGMAP_IE_COMPAT
: Whether or not to wrap the rendered SVGs in special markup
for compatibility with legacy Internet Explorers. Enabled
by default; disabling leads to slightly nicer markup.wagtail.contrib.modeladmin
is enabled, ImageMap
objects can be created
from the Wagtail admin (look for "Image Maps" in the menu).
Once you've selected an SVG file, you can create region objects to set which
pages/documents/external URLs each discovered ID should link to.ImageMap
objects.
Once you've selected an SVG file, you can then set which pages/documents/external URLs
each discovered ID should link to.ImageMapBlock
-enabled stream field, select the image map to use.
You can also additionally set a CSS class to wrap the field with. Ask your friendly
neighborhood designer for more information.py.test
for testing.