Allow up to 3 CTAs per card#1701
Draft
mwvolo wants to merge 1 commit into
Draft
Conversation
Bump the cards cta_block max_num from 1 to 3 so a card can hold multiple CTAs. Help text notes that buttons beyond the second need an explicit style. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the Root/Flex “Cards Block” schema to allow multiple CTAs per card by increasing the allowed number of CTA items, and includes the corresponding StreamField migration so editors can enter up to three CTAs.
Changes:
- Increase the cards block
cta_blockListBlock limit from 1 to 3. - Update CTA button style help text to guide editors when adding a 3rd+ CTA.
- Add migration
0176to persist the StreamField definition change.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| pages/models/constants.py | Raises cards-per-card CTA ListBlock max_num from 1 → 3. |
| pages/custom_blocks.py | Updates CTA style help text to account for additional CTAs. |
| pages/migrations/0176_alter_rootpage_body.py | StreamField migration reflecting the updated CTA ListBlock configuration/help text. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
40
to
44
| ('cta_block', blocks.ListBlock(CTALinkBlock(required=False, label="Link"), | ||
| default=[], | ||
| max_num=1, | ||
| max_num=3, | ||
| label='Call To Action' | ||
| )), |
| ('blue_outline', 'Blue Outline'), | ||
| ('deep_green_outline', 'Deep Green Outline'), | ||
| ], help_text='Specifies the button style. Default unspecified, meaning the first button in the block is orange and the second is white.')), | ||
| ], help_text='Specifies the button style. Default unspecified: the first button in the block is orange and the second is white; set a style explicitly for any additional buttons.')), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Bumps the cards block
cta_blockmax_numfrom 1 → 3 so a card can hold multiple CTAs. Migration0176.Why a separate PR
Split out of the Batch A work per Tom's review, which questioned whether multiple buttons per card is a good idea. Isolated here so that decision can be made on its own.
Companion
Pairs with flex-pages #12 (the renderer change that actually renders all CTAs). Without that, this only changes what editors can enter. The renderer currently has no default style for a 3rd button, so the help text notes that additional buttons should set a style explicitly.
Adds
0176_alter_rootpage_bodyoff0175. If other body-altering PRs land first, rebase + regenerate.🤖 Generated with Claude Code