ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Adding spans to paragraph text in channel fields

October 07, 2011 3:32pm

Subscribe [2]
  • #1 / Oct 07, 2011 3:32pm

    Certified K

    10 posts

    Hi All,

    Question about EE and Channel Fields…

    Let’s say I have the following code (in HTML/CSS):

    HTML

    This is just some <span>dummy text</span>. There is absolutely <span>no meaning</span> to this text.  It is here so I do not have to use <span>Lorem Ipsum</span>.  (I can't read latin.)

    CSS

    .yes span {font-size: 150%; color: red}

    Problem
    I want the spans inside the paragraph.  The first method I can think of is to have the following settings in the Channel Field:

    Option 1:
    Default Text Formatting for This Field:  none
    In Template:  {yes}

    This works great for being able to add the paragraph class, but doesn’t allow for putting in the spans.  On the other hand, if I had the following settings:

    Option 2:
    Default Text Formatting for This Field:  none
    In Template:  {yes}

    I could type my spans in the input box for that channel field.  However, for the client, that’s asking them to add HTML and I’d like to avoid that if at all possible.

    Suggestions?

  • #2 / Oct 07, 2011 7:07pm

    Rob Allen

    3114 posts

    If you want to highlight known words/phrases you could use a find/replace plugin to do this automatically, http://devot-ee.com/search/results/search&keywords=replace&channel=addons&addon_version_support=ee2/ has some ideas.

    Otherwise it’s woth considering using a WYSIWYG addon so your client can format text more easily.

  • #3 / Oct 07, 2011 11:27pm

    Certified K

    10 posts

    Thanks Rob.  I think I’ll take the WYSIWYG approach and add a button for those special spans.  Thanks for the idea.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases