Able to insert selected text into snippet

Created on 29 September 2023, about 1 year ago
Updated 8 July 2024, 6 months ago

Problem/Motivation

We are developing a template to work with the shortcode module. The shortcode wrappers sometime need text for the frontend rendering. We have a lot of existing content that needs to work this template. Instead of using the template to insert the predefined snippet and then have the author copy and paste the text into it, allow the author to select the text, then select the template from the drop down and have it apply with the selected text at a defined place within the snippet.

Steps to reproduce

N/A

Proposed resolution

In the template's json, add new key like

"allow_replacement": true|false

and for the existing "html", allow a replacement placeholder like

"html": "My name is $selected_text$."

So if I select "Maria" in the ckeditor text, the output after choosing this snippet will be

My name is Maria.

Remaining tasks

N/A

User interface changes

N/A

API changes

N/A

Data model changes

N/A

✨ Feature request
Status

Closed: won't fix

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States binyc01

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024