wagtail / wagtail.org

Wagtail’s official marketing website
https://wagtail.org/
66 stars 60 forks source link

Block cleanup on BlogPage #346

Closed vossisboss closed 1 year ago

vossisboss commented 1 year ago

There are two main things that need to happen for this issue to be addressed. First, old block types that we are no longer using anymore need to be removed from the StreamField for BlogPage so that people won't use them anymore. Second, certain blocks from ContentPage need to be added to BlogPage so people can use them in their blogs as well.

The following blocks need to be removed from BlogPage so that people don't use them anymore:

The following blocks from ContentPage need to be available in BlogPage:

When these blocks are added to BlogPage, we'll need to confirm that they display appropriately with the frontend styles used for BlogPage.

fyunusa commented 1 year ago

Hi, @vossisboss i'll be taking up on these. Hoping to send a good report soon

vossisboss commented 1 year ago

Thank you for giving this a go @fyunusa. Do let us know if you have any questions.

fyunusa commented 1 year ago

Hi @vossisboss , i have been able to remove the blocks from blogPage and added the blocks needed from contentPage.

Screenshot 2022-11-20 at 12 44 47 PM

But then i have few things to clarify on.

First The the BlogStoryBlock inherits from the utils storyBlock and extends it with a method for the standalone_cta block, which makes up the current BlogStoryBlock , using same approach i was able to extend the BlogStoryBlock with new Blocks needed:

Secondly Due to the BlogStoryBlock inherits from the utils StoryBlock with my little knowledge of the system

The current codebase shows that these blocks are to be removed from the utils StoryBlocks

imagecaption = ImageAndCaptionBlock(label="Image caption")  # to be removed
    colourtext = BackgroundColourTextBlock(icon="pilcrow")  # to be removed
    calltoaction = CallToActionBlock(icon="pilcrow")  # to be removed
    tripleimage = TripleImageBlock(icon="image")  # to be removed
    stats = ListBlock(StatBlock(icon="code"))  # to be removed

These blocks don't indicate to be removed and might affect other components using them if we have to remove them from the utils StoryBlock

vossisboss commented 1 year ago

@fyunusa I think those blocks weren't labeled as # to be removed because they got missed when we were evaluating which blocks to keep and which ones to remove. I'm aware that removing them might affect other components but since we aren't planning to use them again, I think it is worth trying to remove them from StoryBlock. Please go ahead and trying removing them.

Does that provide the clarity that you need to proceed?

fyunusa commented 1 year ago

ok, yeah thank you @vossisboss clarified already