Results 1 to 8 of 8

Thread: Modification to the Headline style drop-down

  1. #1
    User
    Join Date
    06-19-09.
    Posts
    106

    Default 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

  2. #2
    User
    Join Date
    06-19-09.
    Posts
    41

    Default 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
    I'm no good at PHP, really...
    I don't know if it's something for you...


    cheers
    Antipitch

  3. #3
    User
    Join Date
    06-19-09.
    Posts
    106

    Default 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
    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?

  4. #4
    User
    Join Date
    06-19-09.
    Posts
    41

    Default 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

  5. #5
    User
    Join Date
    06-19-09.
    Posts
    106

    Default 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.

  6. #6
    New user
    Join Date
    06-11-09.
    Location
    Valence, France
    Posts
    21

    Default 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

  7. #7
    User
    Join Date
    06-19-09.
    Posts
    106

    Default 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.

  8. #8
    New user
    Join Date
    09-07-09.
    Posts
    4

    Default Re: Modification to the Headline style drop-down

    thanks for advice

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •