Not a bug Template 'message_macros' Not Respecting Value display HTML

frm

Well-known member
Affected version
2.1.4
The 'message_macros' template is not respecting the Value display HTML of user custom fields, unless there is another way of calling custom fields to display the HTML than shown below...

Example:
1571671881843.png

Template (with HTML and view):
1571671941584.png

1571671981569.png

Template with just the variable, which should revert to the value display HTML and view:
1571672135856.png

1571672187728.png
 
1572870097176.webpCan I just confirm that you are editing the message_macros template in order to add your ppMeLink code?

If so, that's really not how the system is supposed to work - you shouldn't need to edit the template, you should simply enable the 'Custom Fields' option in the messages style properties group, and then the value display HTML will be output in the appropriate place.

There is currently no simple way to restrict the visibility of custom user fields to registered members only.

What you are currently doing appears to be calling the simple value of the custom field ($user.custom_fields.ppMeLink) rather than the HTML-formatted version, which can only come by calling the appropriate template macro along with the field definition, which includes the {$definition.getFormattedValue($value)|raw} call.
 
that's really not how the system is supposed to work - you shouldn't need to edit the template, you should simply enable the 'Custom
I didn't like it in the list format with the name: value format as display HTML could be text to an image and that format would throw a custom display off.
$definition.getFormattedValue($value)|raw
I'll give this a shot. Thanks!
 
Top Bottom