verbb / vizy

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

Support for Feed Me #2

Closed engram-design closed 2 years ago

engram-design commented 3 years ago

While basic support is provided for Feed Me (allowing just the WYSIWYG items), there's no support to import into Vizy blocks.

The challenge will be how to group content nodes into Vizy blocks, which is tricky with Feed Me's mapping.

engram-design commented 3 years ago

Seeing as though this is a popular request, I'd love some feedback and maybe examples of how people would expect this to work. It's different to Matrix, where everything is a structured block, instead we're mixing "plain text" with blocks.

In your feed, you might have something like:

[
    "<p>Lorem ipsum dolor sit amet, <b>consectetur</b> adipiscing <em>elit</em>. Cras ac ultricies enim, nec scelerisque nisi. Duis scelerisque quam et posuere porttitor.</p>",
    {
        "plainText": "Some value",
        "richText": "More text"
    }
    "<p><a href="/">Duis scelerisque quam et</a> posuere porttitor.</p>",
    {
        "video": "http://...",
        "aspectRatio": "4:6"
    }
]

My biggest concern is that the above structure is highly opinionated, and probably not a real-world scenario. You might have two bits of text - you might want to make one portion of text as just formatted text, the other in a particular block type's field. If that's the case, that might be almost impossible without some core Feed Me alterations to cater for that. It might be able to be done.

Feedback welcome!

Mosnar commented 3 years ago

Unfortunately, I don't have an "easy" suggestion here - for what it's worth, I think even basic support for simply importing rich text would be extremely valuable. Not being able to import content is the biggest roadblock holding us back from adopting Vizy, as our work typically involves importing a bunch of blog posts from a Wordpress site or other scraped site. Importing subfields is a secondary priority.

engram-design commented 2 years ago

I've added (basic) Feed Me support for the next release. To get this early, change your verbb/vizy requirement in composer.json to:

"require": {
  "verbb/vizy": "dev-craft-3 as 1.0.8",
  "...": "..."
}

Then run composer update.

engram-design commented 2 years ago

Added in 1.0.9

tomkiss commented 2 years ago

@engram-design Quick question, hope this is the best place to ask.

Exporting entries with Vizy fields from the Craft CP entries page gives a file with all the expected Vizy blocks. But there's no way to re-import this back in with Feed Me, is that correct? From what I can gather (some docs on support for Feed Me might be helpful 🥺), the Feed Me implementation only supports importing WYSIWYG text into a Vizy field?

I got halfway through writing a matrix to vizy parser in node (to create FeedMe-importable JSON files) before I running into problems. Is there a timeline on Vizy Block support for Feed Me? (I'm not on Craft 4 for this project, which probably isn't helpful).

engram-design commented 2 years ago

@tomkiss That's correct, Feed Me only supports importing WYSIWYG content, and that'll be the case into the near future. There's a lot of work dealing with how to take content from a feed and turn it into repeatable content in a Vizy field, in the form of blocks.

I'll have to do a write-up about how to create a ProseMirror schema that you can use to save content in its raw fashion to a Vizy field, which would include Vizy block data.

davorpeic commented 1 year ago

Hey Josh @engram-design

did anything changed from september, I mean is it possible to somehow write raw data to get blocks imported into vizy field in any way using Feedme?

thanks dp

engram-design commented 1 year ago

Nope, only WYSIWYG content is supported. Mapping "raw data" to Vizy blocks would be tricky.