I am learning Wagtail and Django. And I got an issue with the following code.
Main goal is to have separate block templates for carousel items and carousel itself. When I start this code in Wagtail with added carousel items, I see that block template carousel_main.html
was parsed by Wagtail but block template carousel_item.html
was not. Most probably I am doing something wrong but I cannot seem to figure it out.
class CarouselBlock(blocks.StructBlock):
image = ImageChooserBlock()
text = blocks.RichTextBlock(blank=True)
class Meta:
template = 'carousel_item.html'
class Carousel(blocks.StructBlock):
carousel = blocks.ListBlock(CarouselBlock(),blank = True)
class Meta:
template = 'carousel_main.html'
class HomePage(Page):
carousel_field = StreamField(
[
('carousel',Carousel()),
],blank = True
)
content_panels = Page.content_panels + [
StreamFieldPanel('carousel_field')
]