I'm working on a relatively large site using Drupal 7, and find myself creating a large number of one-use, page-specific blocks in order to embed custom content on some of the pages in this site. Is this the best way to go about doing this, or are there other alternatives?

I've used the Views module for a few things, but it is not always able to meet my needs.

up vote 9 down vote accepted
+500

You should look at the Bean module as a possible alternative to answer this question. 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.

Combined with the options available for granting Bean permissions, it should give you a lot of flexibility about how exactly you want to use this (great) module.

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.

A rising star ...

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.

I'm not aware (yet) of any other contributed module that "only" started in D7, and made it right into core in the very next major Drupal release ... If there are other modules with a similar track record, I doubt there would be many of them ...

  • This definitely seems like the right direction, thank you. – Tyler Oct 29 '15 at 15:27
  • Thx for the update, pretty sweet that they added this awesome module to D8 core. – No Sssweat Jan 29 '16 at 10:38

If the content of that block is related to the content of that page/node, you could add an extra field to your content type(s), then use the CCK Blocks, Field as Block or Region View Modes module to display that field in another region of your theme. I think that Views is too heavy in this case.

You could add a field called "block" to your content types, then use the Views module to display the block field.

Just throwing my 2 cents in there.

I like to use the Ctools Content Panes module for some bits of custom content.

Then if this content is to be shown on certain page(s), use a module such as Ctools Field or Pane Field to create a multiple value field on a node to reference the custom pane(s) as needed on nodes.

Your Answer

 
discard

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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