Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt November 11, 2024
Ocean West Posted June 15, 2017 Posted June 15, 2017 have a checkbox set in a custom field but would like the display on the profile to be comma separated? How would i do this?
clearvision Posted June 15, 2017 Posted June 15, 2017 You can modify template core->front->profile->profile with: {{$fields['core_pfield_2'] = str_replace ('<br>',',',$fields['core_pfield_2']);}} Inserted in before the profile fields loop (search cProfileFields). 2 is the id of the profile field (if you edit profile field you will see id at end of url in browser). The resulting area should look like: <div class='ipsWidget_inner ipsPad'> <ul class='ipsDataList ipsDataList_reducedSpacing cProfileFields'> {{$fields['core_pfield_2'] = str_replace ('<br>',',',$fields['core_pfield_2']);}} {{foreach $fields as $field => $value}} <li class='ipsDataItem ipsType_break'> <span class='ipsDataItem_generic ipsDataItem_size3 ipsType_break'><strong>{lang="$field"}</strong></span> <span class='ipsDataItem_generic'><div class='ipsType_break ipsContained'>{$value|raw}</div></span> </li> {{endforeach}} </ul> </div>
Ocean West Posted June 15, 2017 Author Posted June 15, 2017 Thank you that worked perfectly... would be nice to have some setting directly on each custom field how to display output.
Ocean West Posted June 23, 2017 Author Posted June 23, 2017 it worked but then on the public profile it repeated a field a few times, haven't had a chance to look at it further. i wonder is there any sort of tags that can be added directly here, that would force the content to be comma separated?
clearvision Posted June 23, 2017 Posted June 23, 2017 What do you mean by "public profile"? You can use the same type of template code as I gave you for the profile template in the display format block you showed. That display format area is only for the info under the users image in posts.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.