I’ve been trying a variety of plugins and solutions to achieve something but wondering if there’s a simple way to achieve this. Here’s what I need:
User needs the ability to add, delete, and rearrange a few types of content for a post they’re making. Primarily these will be images but a way to add in a header and/or some text and then some way of adding a YouTube embed or native upload/player would work, but generally the big thing is figuring out how to structure this.
Here’s an example of what I’m trying to do, where you’d start with an empty page and have a few “add” options for content types. They would add from top to bottom with the ability to delete each “block” and reorder them:
Once the user is happy with the post, they’d publish and this would create a new entry data type with a display page that others can see but not edit.
I checked out the Modular Text plugin which does almost exactly what I need but its JSON format only, I also see there’s a few repeating group reordering plugins which might work for the reorder aspect, but in this case there are more then one type of data type.
I sense there’s a pretty straight forward way to do this but I might just be missing a simple solution.
how are you relating the post contents to the post as a datatype? If I were to build this I would create a datatype called “post elements” for example and give it a type and order properties. The post is a repeating group of post elements of different types sorted by order. This way you can simply use the order icon to change the order as a number for all related elements based on the desired action (up or down).
Thanks @hanan1, would this work if the user wanted to have say Text 1, Image 2, Text 2, Image 2, Image 3, Image 4, Text 3? Or would all have to be text, text, text, image, image, image?
Essentially my goal is to have them click a button to add a single image which adds to the top of the list. Then they could click add text, which adds beneath the image they just added, with the ability to move that text above image 1, and so forth.
I think the thing I am getting tripped on is, usually you define in the DB a “post” as data type and then a field called “image” as single image, but in my case they could have 1 image or 5 and they’d be in various orders. If I do a field that’s a list of images, they’d all show up in one repeating group instead of a single instance of an image, text, image, etc.
Thanks for explaining I understand what you need clearly now it is exactly as I assumed. My solution would be to create a datatype called post element. This datatype has all possible types as properties (image, video URL, header text, paragraph text) as well as type and order. I will explain later today with an example video. What you are trying to achieve is perfectly doable.