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

Copy field values from other sites #14056

Draft
wants to merge 44 commits into
base: 5.x
Choose a base branch
from

Conversation

brianjhanson
Copy link
Contributor

@brianjhanson brianjhanson commented Dec 18, 2023

Continuation of #12436 but instead of handling the copy server-side, the controller will return fragments of HTML that we use to replace fields and immediately save a draft. This simplifies the logic a bit as we can rely on existing "Save Draft" processes to save the values.

Description

On the entry/category edit page (elements that support autosaving drafts):

  • Added an item to the action menu that allows you to copy all, translatable, changed values from another site
  • translatable field icon now triggers a HUD, which contains a form that allows you to copy just that field’s value from the selected site;
    copy action is applied to the top-level fields (e.g. entire matrix field)
  • plugins need to implement CopyableFieldInterface to use this feature

IMPORTANT: once this feature is released, an update to craftcms/html-field needs to be released; craftcms/html-field#6

CleanShot.2023-12-19.at.13.44.44.mp4

i-just and others added 30 commits November 30, 2022 17:25
# Conflicts:
#	src/controllers/ElementsController.php
#	src/web/assets/cp/dist/cp.js
#	src/web/assets/cp/dist/cp.js.map
#	src/web/assets/cp/dist/css/cp.css
#	src/web/assets/cp/dist/css/cp.css.map
#	src/web/assets/cp/src/js/ElementEditor.js
…:craftcms/cms into feature/cms-979-copy-field-values-from-other-sites
Copy link

linear bot commented Dec 18, 2023

@brianjhanson brianjhanson force-pushed the feature/cms-979-copy-field-values-from-other-sites branch from 1458c2b to 7e90323 Compare December 18, 2023 23:19
@brianjhanson brianjhanson force-pushed the feature/cms-979-copy-field-values-from-other-sites branch from 7e90323 to 3c2a490 Compare December 19, 2023 15:27
The primary gain here is that we don't need to re-initialize them after replacing DOM elements
The primary gain here is that we don't need to re-initialize them after replacing DOM elements
@brianjhanson brianjhanson changed the title Feature/cms 979 copy field values from other sites Copy field values from other sites Dec 19, 2023
@piotrpog
Copy link

I think this was "missing piece" of multi-language functionality of Craft CMS. Thanks for adding this.

@brandonkelly brandonkelly changed the base branch from 5.0 to 5.x March 26, 2024 17:52
@mmikkel
Copy link
Contributor

mmikkel commented May 10, 2024

I think this was "missing piece" of multi-language functionality

I concur; really looking forward to seeing it merged. Any chance it'll make it into 5.2? 😇

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

Successfully merging this pull request may close these issues.

None yet

5 participants