Skip to content
This repository has been archived by the owner on Nov 9, 2021. It is now read-only.

Add ckeditor_templates module to GovCMS8 #440

Open
simesy opened this issue Apr 8, 2020 · 9 comments
Open

Add ckeditor_templates module to GovCMS8 #440

simesy opened this issue Apr 8, 2020 · 9 comments
Labels
enhancement Module Module requests and discussion

Comments

@simesy
Copy link
Contributor

simesy commented Apr 8, 2020

As an editor, I want to insert pre-structured markup into the wysiwyg editor.

Solution: https://www.drupal.org/project/ckeditor_templates

** What value does this module/package add to GovCMS?

It's possible to configure wysiwyg so that entering complex markup is respected and output to the browser. An example of complex markup.

<div class="breakout">
    <h5>What to expect...</h5>
    <p>This is some important information.</p>
    <p>Something else.</p>
</div>

Unfortunately site builders do not have the tools to enable editors to insert templates like the above, so that the elements and classes match the expectations of the CSS.

This module allows govcms saas themers to define template snippets in the theme, it then offers these templates to the editor.

** Please provide a brief outline of what this module does.

Integrates the ckeditor templates plugin to Drupal so that templates can be defined in the theme.

** Who does this module benefit:
[ ] end users
[x] content editors
[x] site builders
[x] themers
[x] developers

** How could you provide/replicate the functionality of this module using alternative methods, eg in your theme?

The alternative is for the editor to hit "source" button in the wysiwyg, and insert structured markup. To match the markup required by the CSS means that the editor will be copying and pasting this markup from somewhere else, and needs to have some HTML skills. It's fiddly and error prone especially for a non-technical editor.

Note that "styles" in the wysiwyg config (eg admin/config/content/formats/manage/filtered_html) only enabled the editor to add a class to a pre-existing element. It's not a solution for this problem.

I've looked at the wysiwyg_templates module and while this module is well supported, it is a lot more complex and i think the complexity is unnecessary.

** If this module styles or alters HTML or JavaScript output, can the functionality be provided via the theme? What alternatives have you considered.

See above

** What is the maintenance and support status of the module. Describe the issue queue activity.

Good. This module has stable release. Active queue. Minimal code anyway.

** What permissions are needed to utilise the module (and are any new permissions provided by the module)?

N/a ✅

** Does the module modify the database structure and/or store additional metadata on nodes or other entities? If so, why? What are the risks for future updates?

No risks really. If you removed this module then existing content would work (it may require editing source). ✅

** Is the module designed to capture anonymous user data?

No ✅

** Is the output of the module typically fully cacheable? Would the inclusion of this module potentially render pages uncacheable.

Yes ✅

** What is your assessment of the quality of this module, the contribution history of the module's maintainers, and the uptake of the module within the Drupal community?

Very happy with the simplicity of it. ✅

** Additional information

@sukhrajghuman
Copy link

sukhrajghuman commented Apr 8, 2020

We would really benefit from this. Right now we are editing in source and that's not a great experience for the content team.

If anybody has other suggestions to get around this, would love to hear. I am a bit of a beginner to Drupal/govcms

@simesy simesy added the Module Module requests and discussion label Apr 8, 2020
@AlexSkrypnyk
Copy link
Contributor

@simesy Great find! Thank you for adding this PR.

Could you please update the description to clarify how exactly templates are managed - is it in code or drupal entities, can they be managed by non-dev user, are there any permissions required to manage the templates. Also, there is a ckeditor_templates_ui module - any reason it is not included for the review?

@simesy
Copy link
Contributor Author

simesy commented Apr 8, 2020

You move this file into the theme
https://git.drupalcode.org/project/ckeditor_templates/-/blob/8.x-1.x/templates/ckeditor_templates.js.example

I'm not advocating for an editor's tool. I think minimalist code like this module is great because it helps site builders deliver solutions to government.

@simesy
Copy link
Contributor Author

simesy commented Jul 2, 2020

It's really difficult to support clients when these issues are left open and unaddressed for months.

@Belhendo
Copy link

Belhendo commented Jul 2, 2020

Hi @simesy

Thanks for raising this again. We have a weekly process to review and respond to issues and PRs that the community make on GitHub. Unfortunately in this instance, your request was missed in the process, leaving you without a response. We are very sorry for the difficulties this has caused.

We will need to review this module internally to determine suitability to the distribution. Thank you for bringing us the recommendation. I will be back in touch again soon.

@Belhendo
Copy link

Hi @simesy

A couple of things on this one:

  1. Do you know if this is compatible for D9?
  2. The team would like to see evidence of this being required more broadly in the GovCMS community before progressing this request further.

Thanks @simesy.

@simesy
Copy link
Contributor Author

simesy commented Jul 17, 2020

Hey Belhendo

  1. Looks like a patch is available at https://www.drupal.org/project/ckeditor_templates/issues/3120267
  2. How is this evidence gathered? happy to help.

@Belhendo
Copy link

Thanks @simesy.

  1. We need to see the module having a release in D9, rather than a D8 patch.
  2. If anyone in the developer community has examples of how this may be required, we'd love to hear it here. Also thumbs up and comments relative to the initial request are helpful.

@simesy
Copy link
Contributor Author

simesy commented Jul 21, 2020

  1. yep fair enough, looks close at least. I need it on one of my projects so might give it a shove.

  2. There was a big thread in the community govcms a year ago which polled people on what modules they wanted/used. Ultimately the list was curated - no point asking people if they want Commerce module of course - and this initial curation is something that is up to the GovCMS team (at the time it was Toby). Out of this poll a number of modules were added an generally this was a good thing.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Module Module requests and discussion
Projects
None yet
Development

No branches or pull requests

4 participants