verbb / vizy

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

Play nicer with the Related plugin #151

Open mattbloomfield opened 2 years ago

mattbloomfield commented 2 years ago

What are you trying to do? A description of what you want to happen.

We use the Related plugin to show reverse relations in the CP. However, if something is linked within a vizy block it doesn't show up there. From what I can tell Vizy doesn't take advantage of the craft relations setup at all... which is why. I'm trying to fork the Related plugin to see if I can make it work but I can't figure out a way to query all Vizy relations beyond looping through each entry, finding Vizy fields, then looping through their content and trying to find IDs (horribly inefficient). If you can point me in the right direction maybe I can solve this myself and do a PR into Related.

What's your proposed solution? A description of how you think this could be solved, including any alternatives that you considered.

Do you store relations anywhere or are they only in the JSON of the field?

Additional context Add any other context or screenshots about the feature request here.

engram-design commented 2 years ago

I'll admit I know nothing about the Related plugin (if that's the correct one?)

But yes, that'll likely be an issue, because Vizy block relations aren't stored in the relations database table.

There's probably not a great solution for this I'm afraid. Vizy just stores minimal content on elements in a Vizy block (IDs and Site IDs), which really have to be looked up. Adding relations will have a significant performance impact on Vizy block fields, which is exactly what we're trying to get away from, and the pitfalls of Matrix/Neo fields.

engram-design commented 1 year ago

Putting this on the backlog for the moment, as this plugin isn't on Craft 4, so this is strictly a Vizy 1/Craft 3 fix.