I've got a snippet which has an HTML editor.
@register_snippet
class GalleryCategory(models.Model):
text_links = StreamField(
[('text', DemoStreamBlock())],
null=True,
blank=True)
panels = [
StreamFieldPanel('text_links'),
]
def __str__(self):
return self.name
When I create an instance from this snippet I am rendering it in the template like this:
<strong>
{% include_block category.text_links %}
</strong>
However, this outputs:
<strong>
<div class="block-text">
<div class="block-aligned_html"><dl>
<dt>html</dt>
<dd>Visit our <a href="/some page/" target="_blank">Facebook page</a> for more albums</dd>
<dt>alignment</dt>
<dd>normal</dd>
</dl>
</div>
</div>
</strong>
Where html, alignment and normal are labels in the text editor.