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

GP-44377: Add custom civioffice form with ckeditor. #35

Merged
merged 13 commits into from
Jan 9, 2024

Conversation

awg-github
Copy link
Contributor

No description provided.

@awg-github awg-github self-assigned this Dec 13, 2023
@jensschuppe
Copy link

Would this be worth a PR to systopia/de.systopia.civioffice?

@pfigel
Copy link
Member

pfigel commented Dec 19, 2023

@jensschuppe yes, probably a good addition! We're planning to add a few more quite Greenpeace-specific things to this form (and haven't tested the existing code yet), but the WYSIWYG-thing can probably be contributed upstream.

The only tricky part is that the "Use PHPWord macros for token replacement" setting may vary if you have multiple document renderers, so we'd either need to switch between WYSIWYG and native textareas depending on the selected renderer, or just document the fact and gracefully remove any HTML added by the editor (might be a bit tricky).

(We were able to just ignore this issue since we only have one renderer where the setting is always enabled.)

@jensschuppe
Copy link

The only tricky part is that the "Use PHPWord macros for token replacement" setting may vary if you have multiple document renderers, so we'd either need to switch between WYSIWYG and native textareas depending on the selected renderer, or just document the fact and gracefully remove any HTML added by the editor (might be a bit tricky).

… because only with this setting tokens are replaced with HTML-formatted token messages …? I'd say we should rather deprecate the regex replacement of tokens in favor of the PhpWord template processor and macros.

@pfigel
Copy link
Member

pfigel commented Dec 20, 2023

I'd say we should rather deprecate the regex replacement of tokens in favor of the PhpWord template processor and macros.

That sounds like the better option indeed.

I think the only real blocker for that (and for replacing everything with WYSIWYG) would be this issue: systopia/de.systopia.civioffice#30
Currently, you'd have to be very careful with how you use formatting, or you'd end up replacing the entire paragraph that contains the token. We can work around this for now, but it's probably going to be a bit confusing for users.

It looks like there's been some prior work on fixing this in a PR. We can provide some funding if you/SYSTOPIA are interested in working on a fix for this?

@jensschuppe
Copy link

jensschuppe commented Dec 20, 2023

Thanks for the funding offer, I'll pass that on to @bjendres, @peth-systopia, @Fabian-SYSTOPIA - not sure why that approach in systopia/de.systopia.civioffice#30 has net been pursued any further.

@pfigel pfigel merged commit 67b8cda into master Jan 9, 2024
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.

3 participants