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

0

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.

  • Thanks for your answer! I'll be trying it! – André Luiz Aug 19 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

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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