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

Update documentation for Matrix Fields in relation to issue #463 #777

Open
wants to merge 1 commit into
base: 5.x
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions docs/guides/importing-into-matrix.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

Importing into a Matrix field is like many other [Field Types](../content-mapping/field-types.md), however, this reference provides a practical example of how to structure your feed properly.

For multi-site setups where matrix fields have per-site or localized content, a specific setup is needed. See [caveats](#caveats) below.

In this example, we'll be importing 2 Entries, which have a single Matrix field called Content Builder. The entry itself has a Featured Image `(Assets)` and Description `(Rich Text)` field. Our Page Builder Matrix field has 3 Blocktypes:

- **Heading**
Expand Down Expand Up @@ -285,3 +287,17 @@ You should now have 2 brand new Entries with our Matrix data populated.
![Feedme Matrix Guide Finish1](../screenshots/feedme-matrix-guide-finish1.png)

![Feedme Matrix Guide Finish2](../screenshots/feedme-matrix-guide-finish2.png)

## Caveats

For multi-site setups, you need to pay special attention as to how matrix fields are propagated.
Since Craft CMS 3.2RC1 these are the options available:

- **Only save blocks to the site they were created in** – this is the same behavior as before pre 3.2RC1, if “Manage blocks on a per-site basis” was enabled.
- **Save blocks to other sites in the same site group** – when saving an entry, all of its blocks will be saved to any other sites that are in the same site group as the current site.
- **Save blocks to other sites with the same language** – when saving an entry, all of its blocks will be saved to any other sites that have the same language.
- **Save blocks to all sites the owner element is saved in** – same behavior as before, if “Manage blocks on a per-site basis” was not enabled.

If you need to import content to a site/language in a multi-site configuration, verify that the propagation method for matrix blocks is set to either one of the first three options above. This allows Feed Me to (re)create or overwrite content blocks only in the specific site targeted for import, instead of overwriting content for all sites.

See issue #463 [Matrix content gets overwritten on import](https://github.com/craftcms/feed-me/issues/463) for reference and for updates.