i need to show the first letter of a first name on customer data i have added this code
{exp:member:custom_profile_data}
<h4 class="username">{exp:member:custom_profile_data}{LEFT(first_name, 1)}{/exp:member:custom_profile_data}
{/exp:member:custom_profile_data}
however its not working , any ideas on how i can resolve this
How you do this depends whether or not Member Custom Profile data fields support use of EE’s Variable Modifier system. If they do - you need something like this:
<h4 class="username">
{exp:member:custom_profile_data}
{first_name:limit characters="1"} {last_name}
{/exp:member:custom_profile_data}
</h4>
If they do not, you’ll need a string manipulation utility such as Streeng
<h4 class="username">
{exp:member:custom_profile_data}
{exp:streeng characters="1"}{first_name}{/exp:streeng} {last_name}
{/exp:member:custom_profile_data}
</h4>
Despite what it says on the Github page, Streeng works just fine with EE6/7.
HTH 🐾
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.