{% load wagtailimages_tags %} {% firstof self.page.url self.link as url %} {% comment %} Allow both types of blocks that use this template with different attribute names. This isn't great, but it works for the time being. {% endcomment %} {% if self.title %} {% image self.image fill-512x512 as card_image %} {% include 'styleguide2/includes/molecules/boxes/card_box.html' with url=url image=card_image header=self.title content=self.text description_classes="!bg-grey-180" classes="drop-shadow" %} {% elif self.content %} {% if self.img %} {% image self.img fill-512x512 as card_image %} {% endif %} {% include 'styleguide2/includes/molecules/boxes/card_box.html' with url=url image=card_image header=self.headline content_blocks=self.content description_classes="!bg-grey-180" classes="drop-shadow" %} {% endif %}