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

How to copy SuperTable field value from one site to another #530

Open
hadomskyi opened this issue Aug 10, 2023 · 1 comment
Open

How to copy SuperTable field value from one site to another #530

hadomskyi opened this issue Aug 10, 2023 · 1 comment
Labels

Comments

@hadomskyi
Copy link

hadomskyi commented Aug 10, 2023

Question

Hi, could you please help me to understand what is the best approach to copy value for one Entry from one site to another site.

For example I have two websites EN and DE

In EN I did add all the field values under SuperTable field and now I want to copy everything to my DE version.

What will be the best approach? Especially for CraftCMS V4.

We tried

// Get the Super Table plugin instance
                $superTablePluginInstance = call_user_func(['verbb\supertable\SuperTable', 'getInstance']);

                // Get the Super Table plugin service
                /** @var \verbb\supertable\services\SuperTableService $superTablePluginService */
                $superTablePluginService = $superTablePluginInstance->getService();

                // Duplicate the blocks for the field
                $superTablePluginService->duplicateBlocks($field, $from, $to);

It is working for CraftCMS V3 but not V4.

Would be awesome if you can elaborate on this!

Issue:

When we duplicate like this on draft and publish draft changes are disappear

Thanks!

Additional context

No response

@hadomskyi
Copy link
Author

@engram-design maybe you know something about it?

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

No branches or pull requests

1 participant