Duplicating flexible editor content including relational nodes with flow #24
-
Hello, I have a flow that duplicates a content item. Presumably I will need to duplicate every relation node in my junction table as well, update the IDs in the duplicated relation node items, and update the IDs in the flexible editor JSON. Is that right - there isn't an easier way? Is there anything else I'll need to think about? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Thanks for the question. I agree that duplication is not quite convenient due to the way it works in directus and the complexity with referencing M2A items in a separate JSON field. I'm afraid that setting the However, to workaround this inconvenience, you can go to your editor nodes junction collection (like For example, copy this from the [
"collection",
"item:related_content.items.collection",
"item:related_content.items.sort",
"item:related_content.items.item:pages.id",
"item:related_content.items.item:posts.id",
"item:gallery.items.sort",
"item:gallery.items.directus_files_id",
"item:video.video_url",
"item:video.video_poster"
] And paste the fields prefixed into the [
"…"
"editor_nodes.collection",
"editor_nodes.item:related_content.items.collection",
"editor_nodes.item:related_content.items.sort",
"editor_nodes.item:related_content.items.item:pages.id",
"editor_nodes.item:related_content.items.item:posts.id",
"editor_nodes.item:gallery.items.sort",
"editor_nodes.item:gallery.items.directus_files_id",
"editor_nodes.item:video.video_url",
"editor_nodes.item:video.video_poster"
] Even if the content items are duplicated, the duplicated M2A junction items loose the connection to the referenced IDs in the Editor JSON. So this issue still exists, but should be solved with rewriting the whole duplication process. |
Beta Was this translation helpful? Give feedback.
Thanks for the question. I agree that duplication is not quite convenient due to the way it works in directus and the complexity with referencing M2A items in a separate JSON field.
I'm afraid that setting the
Item Duplication Fields
for each content collection as well is the only way to get this to work.However, to workaround this inconvenience, you can go to your editor nodes junction collection (like
post_editor_nodes
),Copy Raw Value
from the already setItem Duplication Fields
, paste it into theItem Duplication Fields
of your content collection (likeposts
) and prefix all copied field values with the M2A field name of your content collection.For example, copy this from the
Item Du…