Modification to the Headline style drop-down
Hello here in the new forum :D
Currently, all headlines have these styles in the drop-down:
h1, h2, h3, h4, h5, h6
So far, so good.
In the website I'm doing at the moment, there are two or three large words at the top of the page before the headline. Technically, these are not headlines. Therefore, they shouldn't have H-tags. I could in the articles add a 'Text' Content Element for these words, followed by a headline. However, I'd much prefer if these couple of word could be inserted with the Headline Content Element. It just makes slightly more sense for the editors -- The Text CE is very 'bulky' to look at just to insert two or three bold words.
Is there are possibility to alter the Headline CE, so that the drop-down looks something like this:
Punch line
h1
h2
h3
Selecting 'Punch line' would then insert something like <p class="punch">text</p> into the page
I've looked at the ce_headline.tpl file but can't see what to do. I'm no good at PHP, really...
Many thanks
Re: Modification to the Headline style drop-down
Hi spirelli,
I'm afraid changing the .tpl won't do it. At least, you'll not get your "punchline"-option into the element select in the BE. For that you'd have to extend the headline ce or build your own "punchline" module.
That's actually not very difficult, but
Quote:
I'm no good at PHP, really...
I don't know if it's something for you...
cheers
Antipitch
Re: Modification to the Headline style drop-down
Quote:
Originally Posted by Antipitch
I'm afraid changing the .tpl won't do it. At least, you'll not get your "punchline"-option into the element select in the BE. For that you'd have to extend the headline ce or build your own "punchline" module.
That's actually not very difficult, but
Quote:
I'm no good at PHP, really...
I don't know if it's something for you..
That'd be beyond my abilities, I guess --- shame. Thanks anyway.
However, just a quick second question: Where would I be able to remove h4 h5 h6 from the drop-down?
Re: Modification to the Headline style drop-down
Hi spirelli,
again you'd have to extend the module to do that. Only quick'n dirty way I could think of is a BE javascript/ DOM manipulation, that removes the h4 h5 h6 options...
cheers
Antipitch
Re: Modification to the Headline style drop-down
Thanks for your reply. I found a way round the whole thing: I've just added a style for h1.ce_headline and use the headline conetent element for the puch line. All other h1 headlines look different.
Thanks again for your brain-picking.
Re: Modification to the Headline style drop-down
Hi spirelli,
In your dcaconfig, you can add this line :
Code:
$GLOBALS['TL_DCA']['tl_content']['fields']['headline']['options'] = array('p','h1','h2','h3');
after you can add a p.ce_headline in your stylesheets for your punchline
Re: Modification to the Headline style drop-down
Ha! Genious!
Thank so much for your help.
I was just adding to that file for some other reason. Thanks so much for your help.
Re: Modification to the Headline style drop-down