2

What's the best way of reusing blocks between sites in Drupal 7? I want to re-use not only the block, but also the block's position in my theme.

Apparently, Features extra is designed for this. However, on the project page, it says that UUID Features Integration is the future of the module.

UUID Features Integration, however, doesn't seem to work (although a patch is available to fix things). Also it has been dropped in favor of Deploy.

Deploy, however,doesn't seem to work with blocks and is designed more for exporting nodes. So, I'm not really sure how it is a replacement for UUID Features.

What is the best practice for what I want to achieve?

PS. this is a new version of the question "Latest Best Practise: Reusing content/functionality between Drupal 7 sites", as I was told to post it as a separate question.

2 Answers 2

2

Page Manager, Panels and Features.

The plugin architechture in Ctools, which is the project in which Page manager belongs, is the best way to re-use blocks, among other things.

All my block placements are done with Panels, and then exported to code with features.

1
  • Yes. I have got this working and its perfect!
    – big_smile
    Sep 16, 2012 at 18:05
1

Another best practise about this topic is to use he Bean module. Here is a quote about its project page:

Think of a Bean as a method to provide new types (compared to node this would be a content type) which then provides an add content interface to create as many blocks as you require (see screenshot below). The bean content can then be placed around the site just like any other block.

This module also works great in combination with the UUID and UUID Features Integration modules. And after you become familiar with the Bean module, you might find other cases in your site where you also want to use this module (which somehow compensates the fact that you need to add another module).

The video tutorial Drupal Bean module tutorial - using Bean Admin UI provides a great introduction to really understand the power of this module, and the kind of things you can do with it (by only using site building techniques, no custom coding involved). It also shows how the Bean module transforms Drupal blocks into fieldable entities.

This module only started as of D7 (because of the "entities" of course that were only introduced in D7), and already has over 22K reported installs. Those who don't use it yet should definitely start looking at it in preparation of some day upgrading to D8. Because this is what is currently shown on its project page (I added the bold markup here):

This module has been included with Drupal 8 core. Refer to this issue for more information.

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.