localgovdrupal / localgov

Installation profile for the LocalGov Drupal distribution.
GNU General Public License v2.0
83 stars 18 forks source link

Better wysiwyg editing for layout paragraphs (uses front end styles) #711

Open andybroomfield opened 5 months ago

andybroomfield commented 5 months ago

This was brought up at BHCC as the page builder is not quite wysiwyg as its rendering in the admin theme. I was pointed to https://www.strikingly.com/ as an example of where they would like to get to.

Wondering what is possible, editing the whole content in front end theme can be undesireble.

Found a module, Mercury editor that does achieve part of this, though it still uses modal pop ups for editing content.

Wondering how hard Puck intergration would be?

Gutenberg is also an option, but that is not paragraphs, it replaces the body field with the Wordpress editor.

Also noting Experince builder is coming down the line.

andybroomfield commented 5 months ago

What installing Mercury editor looks like:

Screenshot 2024-05-20 at 10 48 41 AM Screenshot 2024-05-20 at 10 48 53 AM
andybroomfield commented 5 months ago

Noting there is also a new experimental field formatter called layout paragraphs builder. This seems to be what Mercury editor is using behind the scenes. To work with Subsites, localgov_base needs to be altered to allow for it. Changing

  {% if node.localgov_subsites_content.value %}
    {{ content.localgov_subsites_content }}
  {% endif %}

to

  {% if node.localgov_subsites_content.value or content.localgov_subsites_content['#type'] == 'layout_paragraphs_builder' %}
    {{ content.localgov_subsites_content }}
  {% endif %}
markconroy commented 5 months ago

I have a feeling that the "Live Preview" initiative is going to become part of core and the default way for achieving a better editing experience.

It might be worth investigating how that works with our LGD set up.

===

Thanks to Big Blue Door for sponsoring my time to work on this.

andybroomfield commented 5 months ago

@markconroy Do you think it's worth making the above change to localgov_base to support layout paragraphs builder on the front end?

markconroy commented 5 months ago

Yes, I've no problem doing that. It's a very simple change.

Do you want to create an issue for it, and I'll get it implemented (perhaps today/tomorrow) which doing my LGD contrib time.

===

Thanks to Big Blue Door for sponsoring my time to work on this.

andybroomfield commented 4 months ago

@willguv This is the issue about replacement editors like mercury editor.

willguv commented 4 months ago

Thanks Andy, will assign this to the editor experience project so we can come back to it

andybroomfield commented 3 months ago

You can remove the tabs in the form when using mercury editor by setting up a dedicated form mode called mercury editor. Would there be much interest in a localgov_mercury_editor module that configures it, based on work BHCC is doing to intergrtate?