verbb / vizy

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

Button that input content #248

Closed jan-dh closed 10 months ago

jan-dh commented 10 months ago

Question

I would like to have the ability to let's say define a couple of buttons that create content instead of applying styles to content. For example:

A lot of the times these buttons would help to provide consistency across content input.

Additional context

No response

engram-design commented 10 months ago

You'll need to get familiar with the Vizy API for adding buttons. Worth checking out the user guides. You'll also need to know a bit about Tiptap, particularly insertContent.

jan-dh commented 10 months ago

Oh totally missed those. Looks super interesting! Thanks 🙏

jan-dh commented 10 months ago

Tried following along the user guide on "Creating a custom Node from scratch" & implemented the Emoji button like in the guide, however, this gives me this error:

image

Database gives me:

[{"type":"paragraph","attrs":[],"content":[{"type":"emoji","attrs":{"emoji":":fire:"},"text":""}]}]
engram-design commented 10 months ago

So that'll just be related to some refactoring we're doing. Fixed for the next release. To get this early, run composer require verbb/vizy:"dev-craft-4 as 2.1.8"

engram-design commented 10 months ago

Fixed in 2.1.9