Share entities based on client

Created on 16 July 2024, 2 months ago

Hello, thanks for developing and maintaining such a great module.

A filtering question/support request.

We currently entity share server/client to synchronise content across 2 sites, we want to expand the number of client sites.

Up to now, we used a checkbox on the server site (synchronise on/off) to filter which entities are available for the client site.
Easy enough to set this up in the filters for the entity_share channel on the server.

With the expansion to the new sites, we would like to share selected nodes to selected sites.
An entity reference/select field of taxonomy representing each new site on the nodes from the server sounds like a good option to tag the content and replace the checkbox.

e.g. on server:
- Original Node A tagged with [Site 1, Site 2]
- Original node B tagged with [Site 1, Site 3]

on clients:
- Site 1 can pull Original Node A, can pull Original Node B
- Site 2 can pull Original Node A
- Site 3 can pull Original Node B

We could create a channel for each client, but with 5 sites and 9 channels each, (similarly to https://www.drupal.org/project/entity_share/issues/2986929 setting up many channels for each site is not very scalable)

All the channels are the same for each site, they just need a different filter based on the site.

What is the best way for this?

Option 1: I would like to create a dynamic filter on the server channel = if [Site 1 client logged in] then only offer Nodes tagged [Site 1]
=> how can I insert the current user ID (presumably the client site user) dynamically to this filter and check whether it's in the taxonomy array for client sites?

(a bit like this https://www.drupal.org/project/entity_share/issues/3232560 , but provide the taxonomy value based from the client site)

Option 2: modify the query from the client site form to pass the client site ID to match the taxonomy tag on the server?
=> do I have to set this as a hook_table_form_alter in a custom module on the client site?

(a bit like suggested here: https://www.drupal.org/project/entity_share/issues/3296012 Let modules to alter query before channel request is made to the server. Needs review )

Option 3: any other suggestions on how to achieve sharing the same channels, but filtering based on client site

Hopefully this makes sense, please let me know if I should describe it further

Thanking you in advance

💬 Support request
Status

Active

Version

3.0

Component

Documentation

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024