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.

Styling field labels in an SAEF custom field loop

July 21, 2010 11:24am

Subscribe [3]
  • #1 / Jul 21, 2010 11:24am

    porthos

    55 posts

    Folks:

    I was wondering if you can style field labels that are generated by the custom field loops. Right now the labels come up with no style at all.

  • #2 / Jul 21, 2010 5:54pm

    Ingmar

    29245 posts

    What version and build of EE are you using? What labels exactly are you talking about, where?

  • #3 / Jul 21, 2010 9:18pm

    porthos

    55 posts

    Using 1.6.9.

    In the SAEF you’ll use something like this:

    {custom_fields}
    {if textarea}
    <textarea name="{field_name}" dir="{text_direction}" cols="50" rows="{rows}">{field_data}</textarea></p>
    {/if}
    
    etc….
    
    {/custom_fields}

    This will automatically add the field label above the text area but the label has no styling. I’d like to apply some HTML tags to the label.

  • #4 / Jul 22, 2010 4:02am

    John Henry Donovan

    12339 posts

    porthos,

    You are free to add your own markup to the SAEF. You could do something like the following

    <div id="customFields">
    {custom_fields}
    
    {if textarea}
    <textarea name="{field_name}" dir="{text_direction}" cols="50" rows="{rows}">{field_data}</textarea></p>
    {/if}
    
    etc….
    
    {/custom_fields}  
    </div>

    Then target labels in your CSS

    #customFields label{
      font-size:11px;
      color:#ff00d2;
    }


    Does that help?

  • #5 / Jul 22, 2010 10:36pm

    porthos

    55 posts

    Almost but not quite. This will affect everything in the div. If there is explanatory text, that too will be affected.

    I probably wasn’t exactly clear. There is no individual “label” tag. In the output, the labels are straight text with no tags at all.

    If I could somehow wrap the label text in tag, that’d be good but I don’t see anything in the SAEF code that will allow that.

  • #6 / Jul 23, 2010 3:44am

    John Henry Donovan

    12339 posts

    Stephen,

    I am just questioning the fact that there is no label markup in the rendered output with the dev team. We will respond here when we have an answer.

  • #7 / Jul 26, 2010 3:42am

    John Henry Donovan

    12339 posts

    Stephen,

    This would be a feature request. You are however able to build out those custom fields for your self. Check this Wiki article for more detail

  • #8 / Jul 26, 2010 9:01am

    porthos

    55 posts

    Thanks John. I suspected I’d have to hard code the form.

  • #9 / Jul 26, 2010 4:58pm

    Ingmar

    29245 posts

    Glad to see John Henry was able to clear things up. Please post again as needed.

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

ExpressionEngine News!

#eecms, #events, #releases