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.
This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.
The active forums are here.
July 21, 2010 11:24am
Subscribe [3]#1 / Jul 21, 2010 11:24am
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
What version and build of EE are you using? What labels exactly are you talking about, where?
#3 / Jul 21, 2010 9:18pm
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
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
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
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
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
Thanks John. I suspected I’d have to hard code the form.
#9 / Jul 26, 2010 4:58pm
Glad to see John Henry was able to clear things up. Please post again as needed.