I have a block that is generated by a view. It brings in the author's name and other information for the specific node that is being viewed. The problem is that the block data is not indexed by drupal since it is not in the "content" of the page. How can I get around this? I tried moving the region to the node.tpl.php but that didn't help. Any suggestions would be great.


You can use the Search by page module but according to this post, the only way to do it is to move your blocks into your theme rather than use the GUI - not really a glamorous solution at all, more of a hack.

But, if you're interested:

$block = block_load('block', 'ID');
    print drupal_render(_block_get_renderable_array(_block_render_blocks(array($block))));

where ID is the if of the block you want to output.


You can use Nodeblock or one of it's competitors:

This module allows you to specify content type(s) as being a block. This allows the content managers of the site to edit the block text and title without having to access the block administration page.

Side effect of managing blocks' content like that is exactly what you want: they can be indexed in search, as they are, in fact, nodes.

If you have dynamically created blocks, you could try to use API provided by Bean module - it works the other way around, exposes blocks as entities, instead of entities as blocks. And if it will not work, well, at least you could use it as an example code for entity <-> block mapping.

  • How does this work in relation to views with arguments? – jsheffers Sep 26 '13 at 14:49
  • Also, I already have 20+ blocks, so how would this work with transitioning to a content type setup. – jsheffers Sep 26 '13 at 15:05
  • @jsheffers for views, it would not work that simple of course - but one of the modules listed under "competitors" links in theory solves this, too. Will update my answer. – Mołot Sep 26 '13 at 17:40
  • Accepted this answer because it get's me closest to the goal, however it does not solve the issue. – jsheffers Oct 24 '13 at 13:35
  • 1
    @jsheffers accepting answer is not a requirement. If it does not quite solve it, no need to accept :) It will not hurt my feelings or anything, you know, but accepting MAY prevent someone from posting answer that would solve it for you 100%. I appreciate your approval, but normal comment "it get's me closest to the goal" + upvote would suffice :) – Mołot Oct 24 '13 at 13:37

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.