Invision Community 4: SEO, prepare for v5 and dormant account notifications Matt November 11, 2024Nov 11
Posted July 17, 20159 yr Hello,@Rikki gave me the following code that displays the raw value of a specific custom field in post bit:{{$fields = $comment->author()->profileFields();}} {$fields['core_pfieldgroups_<group_id>']['core_pfield_<field_id>']|raw}How do I do either of the following:1) Display the formatted value of the field, instead of raw2) Only display the code if the field value exists?Thanks in advance
July 29, 20159 yr You should refer the real table field like this:$record->field_50 Otherwise the field value will always be parsed in any way.
July 31, 20159 yr Author You should refer the real table field like this:$record->field_50Otherwise the field value will always be parsed in any way.Thanks, but I'm talking about custom profile fields, not record fields..
August 18, 20159 yr Hello, Write some examples what you want 1) Display the formatted value of the field, instead of raw You mean
August 18, 20159 yr I think his problem is very similar to mine here, which is that if you call a field that way, it appears in its raw form but without any formatting. Yes, it's possible within the template to type some html, but that's still not good in situations like mine where you want to suppress the label in one field/have nothing at all appear if there's no value for that instance/have custom formatting depending on the output.
August 18, 20159 yr Author Hello, Write some examples what you want You mean Hello, Thanks for the response. Yes, what I want is to show the "Display format" but the code in the OP only returns raw.
August 18, 20159 yr Author I think his problem is very similar to mine here, which is that if you call a field that way, it appears in its raw form but without any formatting. Yes, it's possible within the template to type some html, but that's still not good in situations like mine where you want to suppress the label in one field/have nothing at all appear if there's no value for that instance/have custom formatting depending on the output.Exactly, except my problem is with profile fields while yours is with record fields :)
August 19, 20159 yr Hello,Thanks for the response.Yes, what I want is to show the "Display format" but the code in the OP only returns raw.{{$fields = $comment->author()->contentProfileFields();}} {$fields['core_pfieldgroups_<group_id>'][<field_id>]|raw}
August 19, 20159 yr Author {{$fields = $comment->author()->contentProfileFields();}} {$fields['core_pfieldgroups_<group_id>'][<field_id>]|raw} Thank you so much! Worked perfectly.
Archived
This topic is now archived and is closed to further replies.