Is there some way we can use <br>
or javascript line breaks in Node, Page and/or Block Title fields?
-
do you want the page break in content or title?– Mohammed ShameemCommented Oct 10, 2013 at 17:47
-
i need line breaks in titles– Fahad Ur RehmanCommented Oct 10, 2013 at 17:50
-
where have I mentioned body– Fahad Ur RehmanCommented Oct 10, 2013 at 17:59
-
possible duplicate of Allowing HTML in block title - where is $block->subject created?– CR47Commented Oct 10, 2013 at 18:02
-
Similar to this: drupal.stackexchange.com/questions/10257/… ?– NeoCommented Oct 10, 2013 at 18:04
3 Answers
When I need that - or something similar - I mostly type something like 'title|subtitle' right in the title field. Then right before rendering, I replace all '|' chars with breaks.
And recently, someone wanted bold & line breaks in titles, so I added a textarea with WYSIWYG and auto-filled the real title field ( that I put hidden ) with a stripped down version of what was in the textarea.
So basically, I use work-arounds. Just a thought.
To solve your problem for Blocks, you can always use the Bean module. That way, you can make different 'types' of Blocks, all fieldable. And then implement the method I used with the WYSIWYG.
-
Thanks, I have used duble pipe sign || and replaced that through javascript. Pipe signs automaticaly removed from page title. Commented Oct 22, 2013 at 21:00
I have found there is good reason why Drupal restricts html in titles. If you need a subtitle, it is best to create an additional field in the content type, then position it using the Display Suite module.
-
I agree that there must be some good reasons but still I want to know if there is a way. Does this aproach works for block titles ?? Commented Oct 10, 2013 at 18:10
-
No, I don't think Display Suite would help with blocks. But you could still create a custom view for a block and customize an additional field below the title as well.– PaulCommented Oct 10, 2013 at 20:03