Topic: Formating inmyownwords Field for Version 2.5.3
I wanted to change the color of the input text for inmyownwords ONLY and leave the other fields as they are. Thanks to vlad, here is the solution.
OPEN: members_profile.tpl
FIND: {field_value}
REPLACE WITH:
<!-- IF field_label == "inmyownwords" -->
<span style="color: #993300">{field_value}</span>
<!-- ELSE -->
{field_value}
<!-- ENDIF -->
NOTES: In the above coding, you need to use the appropriate label name you want to format and the color code you want. I wanted to simply format the color of the text so I used <span style="color: #993300">{field_value}</span> to accomplish that. Nothing is stopping you from using other html code to format your text -- i.e. use different font, font size, etc.
THE WHOLE CODE:
It is important that you replace {field_value} with all the above coding. The reason I emphasize this, it is easy to forget to provide the appropriate number of <!-- ENDIF --> codes to close the IF statements. To see what ALL the coding looks like between the <dd> tags with the above changes, it looks like this:
<dd>
<!-- IF field_value -->
<!-- IF field_type == "checkbox" -->
{break:field_value}
<!-- ELSE -->
<!-- IF field_label == "inmyownwords" -->
<span style="color: #993300">{field_value}</span>
<!-- ELSE -->
{field_value}
<!-- ENDIF -->
<!-- ENDIF -->
<!-- ELSE -->
<!-- ENDIF -->
</dd>VARIATIONS
Once you understand what code to use, nothing stops you from building upon that. For example, changing the color of two fields.
<dd>
<!-- IF field_value -->
<!-- IF field_type == "checkbox" -->
{break:field_value}
<!-- ELSE -->
<!-- IF field_label == "inmyownwords" -->
<span style="color: #993300">{field_value}</span>
<!-- ELSE -->
<!-- IF field_label == "wanttomeet" -->
<span style="color: #660066">{field_value}</span>
<!-- ELSE -->
{field_value}
<!-- ENDIF -->
<!-- ENDIF -->
<!-- ENDIF -->
<!-- ELSE -->
<!-- ENDIF -->
</dd>In the above coding "wanttomeet" is not a default field but a custom field I created.
I realize I'm far from an coding expert, so if there is a better way of coding the two fields for formatting instead of using two IF statements, please comment.
LAST COMMENT
Not all fields are created equal. What I mean by that is that some fields are hard coded into the template while other fields are dynamic (like inmyownwords). If it is a dynamic field, you will have to use IF statements to accomplish your task. If it is hard coded into the template, than like any html document, you code the field right in the template using CSS or HTML.
Last edited by db3204 (2009-10-06 13:50:06)