0

I'm working on a feature of a Drupal 8 multisite with separated databases for each site trying to implement the following requisite.

When posting news to the main site (all the other sites are subdomains) the user has to have the option to choose other sites where he wants the same news to be available.

I"m starting doing this with a module and hooks, BTW I never worked with Drupal before, and I'm guessing if there is an existing module that could do that.

Would someone recommend a module I could try?

Thanks for any help

2 Answers 2

1

On the publishing end, you'd need to categorize the data by site (e.g. use term references). Then expose that data as JSON using the built-in Views module. Allow that view to filter by site, to allow the subsites to select the content it wants to import.

On the consuming end:

  • There used to be the Feeds module that allowed a Drupal site to fetch data from a source and load that data onto content types on the site. But that module is still in development.

  • Alternatively, you could build a migration that is triggered in a hook_cron(). Migrate is already in core, I recommend also installing Migrate Plus and Migrate Tools for additional utilities.

In both cases, they would hit the main site at the url that Views is exposing, filter by the site term they want, and consume the JSON it returns.

1
  • Thanks for your answer! I'll be trying it! Aug 19, 2019 at 18:36
0

Now there is a new approach using Deploy - Content Staging module which allows, in collaboration with Multiversion, Replication, and RELAXed Web Services modules to share content between different Drupal 8 sites.

You can find very good documentation on how to use Deploy module for sharing content on multisite here Also, you can visit the official module website from here

4
  • Thanks for your answer! I'll be trying it! Aug 19, 2019 at 18:36
  • Beware the Multiversion module.
    – Kevin
    Aug 20, 2019 at 11:51
  • @Kevin would you elaborate? Aug 20, 2019 at 14:48
  • Once you have it, you cannot get rid of it.
    – Kevin
    Aug 20, 2019 at 15:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.