3

I was wondering how to add superscript characters like trademark to Drupal block title.

7
  • 2
    Is there a reason why you cannot write “™” or “®” as such? Aug 16, 2013 at 11:47
  • @JukkaK.Korpela That would be invalid HTML
    – Clive
    Aug 16, 2013 at 11:59
  • 3
    @Clive, the characters “™” or “®” are certainly allowed as data characters in HTML. Aug 16, 2013 at 13:26
  • 1
    @JukkaK.Korpela I'll take your word for it; my assumption was that anything that has an equivalent specific HTML entity defined (®/™) would have been done so for the obvious reason, not just for the sake of it. Could you provide a source?
    – Clive
    Aug 16, 2013 at 13:37
  • 3
    For example, the HTML 4.01 specification declares, in its somewhat sloppy style, the document character set as ISO 10646, which is equivalent to Unicode; the formal definition of allowed characters is in the SGML Declaration of HTML 4, which is very theoretical – HTML was never actually implemented as an SGML application – but still reflects the reality in the sense that all Unicode characters, except characters in explicitly excluded ranges, are allowed in HTML. Aug 16, 2013 at 16:59

2 Answers 2

3

Block Class Styles may be useful:

Extends the Block Class module to incorporate styles (or themes) rather than css classes. Adds style-based tpl suggestions. Allows HTML in your block titles.

Other options would be to create your block in code, and set the $block->subject to be your <sup> inclusive title, or to override the block-XYZ.tpl.php for the your particular block and add the title in there.

By default, Drupal core runs check_plain on any UI created blocks, so through the UI I don't think there's another option.

2

Trademark ™ is just a character, it doesn't need html. There is no reason why you can't have special characters in block titles.

Superscript as in sup tags is a different story, see the other answer.

How to type symbols? http://www.wikihow.com/Type-Symbols-Using-the-ALT-Key

2

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.