1

What I would like to do is be able to choose what type of Headline HTML element (h2, h3, etc) to use for each block's title. The only way I can find to change a block's Title is in block.tpl.php. But this forces every block on the site to all have the same Headline.

I've Google'd and searched Drupal.org for a module or manual way to do this but have not found one. Does anyone know of a module that does this? would be cool

1 Answer 1

1

I know you are asking about D7, but you are missing a key point about templates. I'd take a gander at http://drupal.org/node/104319 which talks in great detail how D6 does it so you can how it can look at different block templates and then think about whether you need to create a module that has a configuration page for its blocks like what you have above or whether block location is enough.

10
  • block-[region].tpl.php would be the closest to what I'm looking for, but it still doesn't offer the level of cusomization I would like to offer my clients. I want them or me to be able to simply place a piece of content anywhere with any headline level, using the "add block" link on the blocks admin page.
    – Ben
    Dec 2, 2011 at 5:02
  • are you sure you are wanting to use blocks then? how about a custom content type/node? there you could have a content field widget'ed with checkboxes for your different h#s and then in your template do whatever you wanted based on that.
    – Jimajamma
    Dec 2, 2011 at 5:10
  • Would I then use Views to determine the display of the Content Type? Is there another way as well? I guess I wanted to use blocks because it's so straight forward and mostly built in to the out of the box functionality.
    – Ben
    Dec 2, 2011 at 13:28
  • 1
    You would tell views what to do. For example, if you created a content type 'special' with fields header_type, thumbnail, and description, views could display them based upon when they were posted, eg, chronologically, or ordered by header type (so, for example, h1s came first, or last, however you wanted). And, with the same data, it could create another page (or block) with just the thumbnails in a grid that people could click on to get to the special. All kinds of flexibility.
    – Jimajamma
    Dec 2, 2011 at 14:24
  • 1
    (or however you want, <<?php print $header_type; ?>><?php print $header; ?></<?php print $header_type; ?>> is probably more in line with the code in a template, but certainly complicated to type in this comment given how many times I've edited my reply lol :)
    – Jimajamma
    Dec 2, 2011 at 22:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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