verbb / vizy

A flexible visual editor for Craft CMS
Other
44 stars 8 forks source link

FEATURE REQUEST: Blocks-only mode #16

Closed adrienne closed 1 year ago

adrienne commented 3 years ago

What are you trying to do?

I'd like a setting to prevent users from using the TipTap editor features entirely, and only allow them to use content blocks. At least, I'd like that once #12 is fixed!

What's your proposed solution? I'm not super familiar with how TipTap works but I'm wondering if you can just make the actual editor part "read-only" or something, so that you can only add blocks?

engram-design commented 3 years ago

So you can do this at the moment, by setting the field config to:

{
  "buttons": []
}

You'll only be able to enter text and manage Vizy blocks, but no formatting options from the WYSIWYG.

aj-adl commented 3 years ago

This is something I'm interested in as well, I've already made fields with buttons set to [], but it still allows text input - the desired result is quite literally blocks only - but given that this is built on top of a text editor, I can see that this might not possible.

Use case is a block based page builder - where you use blocks to define the content, and then nested vizy fields (and others) for actual content.

Currently, if you want this type of setup, you need to use matrix at the top level, with Vizy fields inside. We really like the JSON approach and have no need to query by field content within the page builder (beyond search) so our desired result is vizy all the way through, but with the user unable to input text at the topmost level.

From reading the docs, we could potentially discard or not render the paragraphs on the top level, but it's not the greatest experience for a client, telling them "you can type but it won't show up".

I understand that this does go a little against the grain of what Vizy is, but to me it's both a 'unique' field type, and a replacement for Matrix with support for nesting, better way (for us) of storing the content and all that jazz, we'd love those benefits over the standard matrix if possible.

engram-design commented 3 years ago

Pretty sure its possible to disable paragraph nodes, but just need to work on the implications of that (being unable to hit "enter" for a new line to create a new block). If nothing else, just some UI work to make this happen, but at the technical level, its possible with some considerations!

mattbloomfield commented 2 years ago

We do this by just throwing out paragraph nodes when rendering. But we also have a custom rendering plugin that does all our vizy transformations and matches it to a pattern library.

engram-design commented 1 year ago

Added "Editor Modes" in 2.1.0