drupalblockdrupal-nodes

Placing block inside a node (positioning block between specific elements in node's content)


Basically I created a webform and enabled it as a block, now I want to put that block inside a specific node. I can do that by placing it in a 'content' region and defining the specific node BUT it displays at the end of the content. Now how can I move it between specific elements inside the content?

The node is using a page-type....tpl.php which is used by 5 other nodes as well so I cannot change the code.

To visualize it looks like:

[ content ]

-description text-

-list of videos-

[ end of content ]

and I need to put my webform between the text and the video list. Is there a way?


Solution

  • There are many roads you could take, but since you said you're considering the template file: Why not use a node-specific template, since page is a node type?

    Say you're on node/123, then you could use a template named node--123.tpl.php (see Drupal 7 Template (Theme Hook) Suggestions) and embed your block right there.

    Alternatively, you could provide a reusable token in a custom module via hook_token_info and combine it with the commonly used token_filter module. But that might be over the top, if it's just one node you need to touch.