Questions tagged [wagtail-streamfield]

Wagtail-streamfield is the feature of Wagtail which let you create a sequence of blocks of different types to be rearranged as desired. Build and arrange your content blocks in any order: headings, paragraphs, images, video, and custom content types specific to your site.

Wagtail is a CMS for Django. Wagtail comes up with lots of features and wagtail-streamfield is one of it. It allows a user to build and arranges content blocks in any order: headings, paragraphs, images, video, and custom content types specific to a site. enter image description here

The outstanding characteristic of it is "Better Rich Text", "Classy Implementation","Simple Editing","Content economy".

170 questions
0
votes
1 answer

Wagtail: how to change css class in auto-generated block?

I have a StructBlock inside StreamFied: courses = StreamField([ ('Courses', StructBlock([ ('Start_date', CharBlock()), ('Name', CharBlock()), ('Description', TextBlock()), ('Image',…
Hater
  • 25
  • 3
0
votes
1 answer

Link feature missing in Wagtail RichTextBlock

I am creating a Wagtail ArticlePage class in models.py. As a part of the body field in my article, which is a StreamField, I created a 'paragraph' component, which is a blocks.RichTextBlock(). When I test it in the admin console, I can create the…
0
votes
1 answer

Using the same StreamField multiple times within a MultiFieldPanel

I have divided a page into sections and I'm trying to use the same StreamField so I don't repeat code but having the same one in different MultiFieldPanel's as per my code below makes it not save correctly, after saving draft or publishing the page…
squidg
  • 451
  • 6
  • 17
0
votes
1 answer

Wagtail SteamFields for community user generated content instead of editor, author workflow

I really like StreamFields, but I don't want the baggage of Wagtail's Publishing system. For example, consider a Forum community site. Instead of using CK Editor or BBCode, Markdown etc form input. I want to give users the option of StreamField…
0
votes
1 answer

Is it possible to have multiple default values in a Wagtail Streamfield?

i Am trying to make wagtail create multiple listing in a streamfield on create new page and give a default value to each listing. The values are passed in a list of dictionarys. ` fasiliteter = StreamField([ ('faselitet',…
0
votes
1 answer

Wagtail - Add data to streamfield CharBlock on save()

I'm trying to automatically fill in a specific charblock on a streamfield I have created on save and I can get it to change but not save because when the page refreshes the new data is not there. def save(self, *args, **kwargs): if…
squidg
  • 451
  • 6
  • 17
0
votes
1 answer

Wagtail Convert StreamField to Dict

I'm trying to convert a streamfield in models.py to a dict on save so then I can get the data and do something with it. from django.http import JsonResponse import json class ProductBlogPage(BlogDetailPage): product_details = StreamField([ …
squidg
  • 451
  • 6
  • 17
0
votes
0 answers

Filter available blocks for StreamField in Wagtail's Editor Interface

I have the following StructBlock subclasses and Page subclass class TestimonialBlock(blocks.StructBlock): class Review(blocks.StructBlock): text = blocks.TextBlock(label=_("Text")) author = blocks.TextBlock(label=_("Author")) …
0
votes
1 answer

How to properly serialize a PrimaryKeyRelatedField in Django Rest Framework

I have two Django models: Book -- which has some Wagtail StreamFields: class Book(models.Model): title = models.CharField(max_length=255) cover_image = StreamField(...) ... Publisher -- which is pure Django: class…
0
votes
1 answer

Wagtail custom API Endpoint doesn't "render / display" streamfield correctly

I'm trying to implement a settings option for social media accounts. Therefore, I created a simple streamfield and registered a class as setting. Took some time as I ran into a bug. That's why I'm curious if the following is a bug or if I just…
0
votes
1 answer

Wagtail streamfield inside a snippet / setting not working as expected

Edit: Seems like I can't add images :(, added links to imgur instead. I'm trying to implement settings in order to enter social media accounts. @register_setting class SocialMediaSettings(BaseGenericSetting): discord_url = models.URLField( …
Tjorbim
  • 3
  • 1
  • 3
0
votes
1 answer

How does WagtailPageTests.assertCanCreate work with streamfield?

I'm trying to write unit tests for a page with a fairly complicated StreamField. I'm having issues with that so I've created a very pared down version to try to understand how WagtailPageTests works and build my way up. My pared down model: from…
BrendaD
  • 15
  • 4
0
votes
2 answers

How to specify features for a RichTextBlock in wagtail

I have a page that is using both a RichTextField and a StreamField with RichTextBlocks. class TwoColumnBlock(StructBlock): content = StructBlock( …
BrendaD
  • 15
  • 4
0
votes
1 answer

Is there a switch to store the Wagtail RichTextBlock content to database in UTF-8?

I am new in Django and Wagtail. I developed a website app using Django 4.0 and Wagtail 2.16.1. I found Django models.CharField by default stores content to database in UTF-8, while Wagtail RichTextBlock by default stores content to database in…
elf
  • 1
  • 2
0
votes
1 answer

Wagtail - Change default HTML-Tag wrapper for StructBlock in StreamField

I noticed that when my StructBlocks render in the frontend, it's html template is wrapped by a div tag. I would like to change this HTML-Tag for a li tag for example. Any possibility to do this?
Darius Mann
  • 637
  • 1
  • 5
  • 14