1

I have spent several hours searching for my solution. I found some but none of them is working. My problem is I have multi-site setup of drupal. Site A has a drupal views generated block of events calendar with next/back navigation of months (mini calendar). I want to use that block in another website of same drupal installation. Both of website has common user tables, theme and modules. I have tried following options until now

  • Web Widgets module, web widget block does not have month header and the navigation. I believe I can not use it without IFRAME.

  • I have also tried setting up REST setup between both domains using clients, OAuth, Services, Remote Views Block modules. Fotunately, connection is set up properly but Remote Views Block module is raising following errors when remote module is added to context.

    Notice: Undefined property: stdClass::$weight in context_reaction_block->options_form_submit() (line 104 of /var/www/vhosts/neumarkets.com/subdomains/southhuron/sites/all/modules/context/plugins/context_reaction_block.inc). Notice: Undefined property: stdClass::$weight in context_reaction_block->options_form_submit() (line 104 of /var/www/vhosts/neumarkets.com/subdomains/southhuron/sites/all/modules/context/plugins/context_reaction_block.inc).

and following errors on other pages when context of remote block is active

Warning: http_build_query(): Parameter 1 expected to be Array or Object. Incorrect value given in clients_connection_drupal_services_rest_7->makeRequest() (line 204 of /var/www/vhosts/neumarkets.com/subdomains/southhuron/sites/all/modules/clients/connections/clients_drupal_rest/clients_drupal_rest.inc).
Notice: Undefined offset: 1 in drupal_http_request() (line 929 of /var/www/vhosts/neumarkets.com/subdomains/southhuron/includes/common.inc).
Notice: Undefined offset: 2 in drupal_http_request() (line 933 of /var/www/vhosts/neumarkets.com/subdomains/southhuron/includes/common.inc).
Notice: Undefined offset: 1 in drupal_http_request() (line 933 of /var/www/vhosts/neumarkets.com/subdomains/southhuron/includes/common.inc).
Notice: Undefined offset: 1 in drupal_http_request() (line 941 of /var/www/vhosts/neumarkets.com/subdomains/southhuron/includes/common.inc).
Notice: Undefined offset: 1 in drupal_http_request() (line 941 of /var/www/vhosts/neumarkets.com/subdomains/southhuron/includes/common.inc).
Notice: Undefined offset: 1 in drupal_http_request() (line 941 of /var/www/vhosts/neumarkets.com/subdomains/southhuron/includes/common.inc).
Notice: Undefined offset: 1 in drupal_http_request() (line 941 of /var/www/vhosts/neumarkets.com/subdomains/southhuron/includes/common.inc).
Notice: Undefined offset: 1 in drupal_http_request() (line 941 of /var/www/vhosts/neumarkets.com/subdomains/southhuron/includes/common.inc).
Notice: Undefined offset: 1 in drupal_http_request() (line 941 of /var/www/vhosts/neumarkets.com/subdomains/southhuron/includes/common.inc).

Am I missing anything here? connection test works properly though and I double checked the module names.

  • Embed widgets and Remote blocks are not available for Drupal 7.

  • I read somwhere (I cant find the source right now) that Drupal 7.x.1.1 supports Remote Blocks in the sense that site has other database configured in settings.php. Do we have its documentation anywhere?

Any help would be much appreciated... I am stuck here..

4
+50

Here's a Shared Blocks module for that purpose written by well known drupal community members.

Features:

  • Allows publishing and subscribing of Drupal blocks
  • Changes to published blocks are updated on sites with subscription blocks
  • Published blocks provides a JSON endpoint at sharedblocks/{module}/{delta}
  • Block subscriptions are updated on cron with an adjustable refresh interval
0

If you don't mind managing some code, you could use Features to export the content types that you want to share into a custom module and keep it in the sites/all/modules directory. Keeping it in sites/all/modules allows the module to be shared across all of your sites and when you need to make changes to the content type, you make those changes on one site, then recreate the feature (there are drush commands to do this, or you could do it through the UI). Finally, you would "revert" the feature on all the sites where it's enabled.

CTools comes with a sub-module called ctools_custom_content which can be enabled and used in conjunction with Panels to create exportable content panes that can be placed across multiple Panels pages. CTools also allows you to create custom plugins (using code) that can be used like blocks on Panels pages.

There's also the option of coding a custom block and putting it in a shared location (i.e. sites/all/modules/mycustommodule/mycustommodule.module) and then using a hook to load and insert this block on whichever page you need.

I often use Features in combination with Panels, CTools Custom Content, and/or custom code when I need a reusable "block". I'm not familiar with a solution that does not involve managing a custom module at one level or another. I'd be happy to provide more details (or at least point to some good documentation) on any of these steps if you're interested.

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.