timkelty / craftcms-site-sync

Sync content to locales on element save.
MIT License
40 stars 9 forks source link

[Feature Request] Site Selection #19

Open joelzerner opened 5 years ago

joelzerner commented 5 years ago

Great work on this plugin!

I've recently begun using the plugin for a project with multiple sites and multiple site groups. My specific use case is to sync content between a Global EN and a US version of a site, however there are other translations and other sites present.

A great feature would be to have a site selector for the field setup, so the content sync would only occur between applicable sites.

For an interim solution, I'm using the plugin and have modified the $siteIds variable to be a manual array of the site(s) I want to update.

timkelty commented 5 years ago

@joelzerner yep, this would be an easy and useful addition.

For your uses, would you only want the site selection on the field settings, or would you want them on the field as well?

The most configurable I think would be field settings where you can select with sites are checked by default, but then you can always change it on the field. However, this may make the field more daunting/confusing that it already is.

joelzerner commented 5 years ago

I would consider enabling site selection in the field settings only as my use case would always have the sites selected be consistent. However I can imagine a scenario where someone may want one entry to sync to all sites and another entry to only sync to one or none.

This leads me to another potential improvement I've discovered which I'll start a new issue for: #20

timkelty commented 5 years ago

@joelzerner if the selection is only in the settings, I would want still to be clear about which sites it was syncing with from the field, even if it just lists them.

joelzerner commented 5 years ago

Sounds good to me!

timkelty commented 5 years ago

This also seems like it could be related to a custom "Translation Method" on your translatable fields…which I haven't really explored yet.

But as I understand it, it allows you do customize for which sites values get copied to.

However, I suppose we'd effectively be overwriting this setting on a per-entry basis, instead of per-field.

…just thinking out loud :)

rob-baker-ar commented 4 years ago

This would be a great feature to have!

timkelty commented 4 years ago

Next time I'm back in the codebase, I'll take a look. Otherwise, PRs are welcome!