Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrating Redactor Variables to CKEditor Placeholder #205

Open
RitterKnightCreative opened this issue Apr 4, 2024 · 3 comments
Open

Migrating Redactor Variables to CKEditor Placeholder #205

RitterKnightCreative opened this issue Apr 4, 2024 · 3 comments
Labels

Comments

@RitterKnightCreative
Copy link

Description

We received the message in the CP that Redactor is no longer being supported which is fine, CKEditor seems to be a better option overall. However, one of the breaking changes that's preventing us from migrating is Redactor has the nifty Variables plugin which allows you to put in placeholder content which later gets replaced with the actual content.

We're using this functionality to let a client customize various aspects of their emails from the CP after one of their online trainings is done, which seems to be an ideal use case for this.

Screenshot 2024-04-04 at 12 09 23 PM

After doing some digging it looks CKEditor has already built something similar, essentially using their demo project as a jump-off.

I took a stab at building this myself (and failing) - but what are the odds this plugin can make it into an official Craft CMS build at some point?

@brandonkelly
Copy link
Member

It looks like those variables are just stored as [% variable name %] markers in the HTML (potentially with different start/end delimiters). So are you then replacing those with actual values in your template using the |replace filter?

If so, that should continue to work in CKEditor, albeit without the UI for automatically inserting the variable marker.

@RitterKnightCreative
Copy link
Author

Appreciate the response Brandon.

Yeh you are correct, we are using replace to swap in the values inserted.

The last part of your reply is most relevant, as they still need some sort of UI for creating new content.

(As an aside I see the marker itself changed between what redactor used previously.)

@Latex88
Copy link

Latex88 commented May 22, 2024

Bump, because I really need this Plugin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants