Skip to content

feat: add hide_content_field config to ElementEmbeddedCode#25

Merged
jsirish merged 1 commit into
4from
feature/hide-content-field
Jun 15, 2026
Merged

feat: add hide_content_field config to ElementEmbeddedCode#25
jsirish merged 1 commit into
4from
feature/hide-content-field

Conversation

@jsirish

@jsirish jsirish commented Jun 15, 2026

Copy link
Copy Markdown
Member

Summary

Adds a hide_content_field config flag (default false) that removes the Content field from the ElementEmbeddedCode CMS edit form, leaving only the embed code field.

This reimplements #15 (which targeted the deprecated master branch and used a hardcoded ElementEmbeddedCode::config()) on the active 4 branch, using static::config() so subclasses can override the flag via late static binding.

Usage

---
After:
  - '#silverstripeelemental-embedded-codeconfig'
---
Dynamic\Elements\Embedded\Elements\ElementEmbeddedCode:
  hide_content_field: true

Replaces #15.

🤖 Generated with Claude Code

Adds a `hide_content_field` config flag (default false) that removes the
Content field from the CMS edit form, leaving only the embed code field.

Reimplements the change from PR #15 (which targeted the deprecated `master`
branch) on branch `4`, using `static::config()` instead of a hardcoded
`ElementEmbeddedCode::config()` so subclasses can override the flag.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@jsirish

jsirish commented Jun 15, 2026

Copy link
Copy Markdown
Member Author

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

🎫 Ticket compliance analysis ✅

15 - Fully compliant

Compliant requirements:

  • Add a config option to hide the Content field from ElementEmbeddedCode CMS edit form
  • Config option should be named hide_content_field
  • Default behavior should keep Content field visible (opt-in to hide)
  • Should work with SilverStripe's config system
⏱️ Estimated effort to review: 1 🔵⚪⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ No major issues detected

@jsirish jsirish merged commit 57fa0db into 4 Jun 15, 2026
16 checks passed
@jsirish jsirish deleted the feature/hide-content-field branch June 15, 2026 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant