From 24a8dfbeed506bcbf95a405df44d9ae500a9b3b1 Mon Sep 17 00:00:00 2001 From: Josh Humphries Date: Fri, 12 Jun 2026 14:14:20 +0100 Subject: [PATCH] chore: load editor pages with sections collapsed DPD have reported some performance issues in the cms editor pages which seems to be most likely caused by the sheer size of some of the pages (in terms of html components present). This commit sets `collapse=True` on a number of key blocks in order to help the initial page render on slower devices. This applies to pretty much all content on the site and hopefully also makes it easier to manage the pages as they are less overwhelming on load - this needs to be validated though. --- cms/dynamic_content/access.py | 4 ++++ cms/dynamic_content/sections.py | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/cms/dynamic_content/access.py b/cms/dynamic_content/access.py index 551c473d52..e490d334a8 100644 --- a/cms/dynamic_content/access.py +++ b/cms/dynamic_content/access.py @@ -13,6 +13,7 @@ ("section", sections.Section()), ], use_json_field=True, + collapsed=True, ) ALLOWABLE_BODY_CONTENT_SECTION_LINK = StreamField( @@ -20,6 +21,7 @@ ("section", sections.SectionWithLink()), ], use_json_field=True, + collapsed=True, ) ALLOWABLE_BODY_CONTENT_TEXT_SECTION = StreamField( @@ -27,6 +29,7 @@ ("section", sections.TextSection()), ], use_json_field=True, + collapsed=True, ) ALLOWABLE_BODY_CONTENT_COMPOSITE = StreamField( @@ -70,4 +73,5 @@ ), ], use_json_field=True, + collapsed=True, ) diff --git a/cms/dynamic_content/sections.py b/cms/dynamic_content/sections.py index 2cc946e7d4..efb06849d1 100644 --- a/cms/dynamic_content/sections.py +++ b/cms/dynamic_content/sections.py @@ -29,6 +29,9 @@ class ContentCards(StreamBlock): help_text=help_texts.FILTER_LINKED_TIME_SERIES_CHART_TEMPLATE, ) + class Meta: + collapsed = True + class FooterCardsSectionWithLink(StreamBlock): section_link = blocks.SectionFooterLink(max_num=1) @@ -41,6 +44,9 @@ class ContentCardsSectionWithLink(StreamBlock): weather_health_alert_card = cards.WeatherHealthAlertsCard() popular_topics_card = cards.PopularTopicsCard() + class Meta: + collapsed = True + class Section(StructBlock): heading = TextBlock(help_text=help_texts.HEADING_BLOCK, required=True)