Skip to content

CMS: link button for the Context fields - #388

Merged
saqibmanan merged 1 commit into
mainfrom
cms-context-link-button
Oct 7, 2026
Merged

saqibmanan merged 1 commit into
mainfrom
cms-context-link-button

Conversation

@saqibmanan

@saqibmanan saqibmanan commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Why

Editors add hyperlinks to Context by typing [text](https://url) by hand. The project and event templates already render Context as Markdown (MarkdownView), so the only thing missing was an editor with a link button.

Change

static/admin/config.yml: all 12 Context fields (7 Work + 5 Events collections) change from widget: "text" to widget: "markdown":

  • toolbar: Bold, Italic, Link, Bulleted List, Numbered List. That covers everything existing Context content uses: links in 30 entries, bold in 2, lists in 2.
  • editor_components: [], so there are no image or code-block inserts in Context.
  • hint: "Select text and use the link button to add a hyperlink."

No template or content changes.

Verified: real Decap 3 (same bundle as production), local decap-server on a scratch copy of the repo

  • The Context field shows exactly those five buttons plus the hint, in both Rich Text and Markdown modes.
  • Select "Kerala" in CORD's Context → Link → enter URL → Publish. The diff is [Kerala](https://…) plus context: > → >- (trailing newline only). CORD's single line breaks are kept.
  • budgets-for-justice (list + 4 links + bold): adding a link via the button saved cleanly. Context changes only - → * list markers.
  • Old vs new Context rendered with showdown 1.9.1 (the site's version): identical HTML apart from the added links for both entries. Same 3 <li>, existing links untouched.

Decap re-serializes the whole front matter on any save (e.g. flow-style resources → block style, null for empty fields), with either widget. That already happens today and is not caused by this change.

Fixes #389

Switch the 12 Work/Events Context fields from the plain text widget to the
markdown widget, limited to bold, italic, link and lists. The site already
renders Context as Markdown, so editors no longer have to type
[text](https://url) by hand.
@saqibmanan
saqibmanan merged commit 27c7fa0 into main Oct 7, 2026
2 checks passed
@saqibmanan
saqibmanan deleted the cms-context-link-button branch October 9, 2026 07:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CMS: link button for the Context fields

1 participant