Skip to content
General Revolution Evolution Add-ons International
Login | Register | MODX.com
MODX Open Source Content Management System, Framework, Platform and More.
Find a Partner | Hosts + SaaS | Jobs | Donate
  • RegisterSign Up with the MODX Community
  • LoginUse Your MODX.com Account
  • MODX Community Forums
  • General
  • Design & Templates
  •  
  • [MODX Revo] second longtitle#

  • 38537
    25

    zapzarap Reply #1, 3 months, 3 weeks ago

    Reply
    • Link to this post#1
    hey there,

    i use the longtitle for my headlines.
    but my headline have two different colors. the html-code looks so:
    <h2>this is my awesome<br>
    <span>headline</span></h2>


    so i need a new field in my document-overview (where the longtitle, description,... is.)

    i don't wanna do this with a new tv in the template variable section. cause that is'n easy for a cutsomer to understand.

    hope for some answers.
    xoxo


  • 33968
    700

    Lucas Reply #2, 3 months, 3 weeks ago

    Reply
    • Link to this post#2
    You mean you want another field for the coloured section of your headline?

    Is there any rule for which word will be coloured? For example if it is always the last word (or 2 or 3...), you could write an output filter that wraps the last word in <span> tags automatically...


  • 28042
    15,112
    How MODx Evo Works

    Log in to an Evo Manager username guest, password guestuser.

    sottwell Reply #3, 3 months, 3 weeks ago

    Reply
    • Link to this post#3
    With custom forms you can set up any kind of fields you want in the resource editing page.

    http://rtfm.modx.com/display/revolution20/Customizing+the+Manager
    http://rtfm.modx.com/display/revolution20/Adding+Custom+Fields+to+Manager+Forms


  • 38537
    25

    zapzarap Reply #4, 3 months, 3 weeks ago

    Reply
    • Link to this post#4
    @Lucas
    That is exactly, what I need.
    I cant use the output-filter, 'cause there is no rule for which word or words will be coloured.


  • 38537
    25

    zapzarap Reply #5, 3 months, 3 weeks ago

    Reply
    • Link to this post#5
    @sottwell
    Is there no other way to do that? A little bit simple perhaps?!
    I can't programming a own plugin for that... :s


  • 33968
    700

    Lucas Reply #6, 3 months, 3 weeks ago

    Reply
    • Link to this post#6
    I think a nice way to do it would be to just use the longtitle field, but have the user wrap the coloured part in asterisks (*). Then an output modifier would replace them with <span> tags when inserting into your page.

    Create a snippet called spanwrap or something that makes more sense with the following (not tested):
    <?php
    return preg_replace('/*(.*?)*/', '<span>\\1</span>', $input, 1);
    

    Then in your template add the modifier to the longtitle tag:
    <h2>[[*longtitle:spanwrap]]</h2>
    

    And get your users to enter the longtitle text like this:
    Longtitle:    This is my awesome *headline*






Actions

Login to Post

Other Support Options

To file a bug or make a feature request visit our issue tracker, or you can also purchase commercial support.

Love MODX?

If you build sites for a living with MODX or just love using it, why not give back?

Information

Posted in this thread:
okyanet, sottwell, zapzarap

 
Back to Top

MODX Global HQ

1333 N Stemmons Fwy, Ste 110
Dallas, TX 75207
United States

+1 (469) 777-MODX (6639)

The MODX Company

  • Contact
  • Media Center
  • Careers at MODX
  • Wall of Fame
  • The MODX Blog

Sponsors

SoftLayer Firehost: Secure Cloud Hosting

Stay Connected

Read our previous email newsletters.

Twitter Facebook Google+ LinkedIn github Feeds

Privacy Policy | Terms of Service | Pixels by AKTA Web Studio© 2005-2012 MODX. All rights reserved. Trademark Policy