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

Add Matrix blocks to Vizy in Craft 5 #314

Open
torgeirbeyer opened this issue Oct 7, 2024 · 4 comments
Open

Add Matrix blocks to Vizy in Craft 5 #314

torgeirbeyer opened this issue Oct 7, 2024 · 4 comments
Labels
feature request New feature or request

Comments

@torgeirbeyer
Copy link

torgeirbeyer commented Oct 7, 2024

What are you trying to do?

I would like to be able to add Matrix blocks to a Vizy field, both Blocks only and Rich text and Blocks in Craft 5.
It is currently possible to set it up in a Vizy field, but when trying to add it on an Entry it returns Invalid owner ID error message.

What's your proposed solution?

I currently have no proposed solutions for this.

But either make it possible, or remove the option to add Matrix fields to a Vizy field to make it more clear to the user.

Additional context

As talked about on Discord.

@torgeirbeyer torgeirbeyer added the feature request New feature or request label Oct 7, 2024
@engram-design
Copy link
Member

There are some complications unfortunately to using Matrix within Vizy fields in Craft 5. This is because unlike Craft 4, Matrix in Craft 5 is all about entries. Matrix fields require the "owner" (in this case, a Vizy field) to be a saved element, but for performance gains, we don't use elements for Vizy.

We've made some workarounds for "As inline-editable block" mode for Matrix fields, and that should be working. Any of the other layouts unfortunately have a different implementation don't currently work.

We're actively looking into a solution for this though, particularly seeing how things like CKEditor deals with this same issue, and working with the Craft team about it.

@JayBox325
Copy link

Tried to use this today and encountered this error, is it possible to remove the Matrix field type from the list of available field types to avoid this error occurring?

Image

Is there an alternative solution for this if we need nested content? My use-case was for adding accordions within the body text instead of it being it's own component.

@engram-design
Copy link
Member

Still working through this, most avenues have unfortunately hit a bit of a brick wall. While looking at CKEditor was a good start, it's not going to be compatible with Vizy. This is because CKEditor doesn't allow multiple instances of itself in a field.

It essentially hoists the owner of the entries you pick to the CKEditor-owner entry, and references that field. While we can do the same with Vizy, because Vizy fields can have multiple Vizy blocks, there's no way to reference which block is meant to own which entry.

But, for now we're stopping people from picking these fields in the Vizy block settings as a temporary measure until we can figure something permanent out. To get this early, run composer require verbb/vizy:"dev-craft-5 as 3.0.5".

@engram-design
Copy link
Member

Updated in 3.0.6 to no longer be able to add Matrix block, but we're looking at more permanent support of course.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants