Jump to content

Template help needed


Kirill N

Recommended Posts

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 raw
2) Only display the code if the field value exists

?

Thanks in advance

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 weeks later...

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.

Link to comment
Share on other sites

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 :)

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...