Posted February 18, 201510 yr I have created a custom field, how do I display it's value in post bit?
July 9, 20159 yr Do you mean this: https://community.invisionpower.com/topic/417661-profile-fields-in-posttopic/ ?
July 9, 20159 yr When you create/edit the field in the ACP, there's a field called "Display format". Enter something like:<strong>{title}:</strong> {content}You can customize this as you see fit.
July 9, 20159 yr Sorry for hi-jacking, but Rikki what would it look like (full string) to have those fields displayed in the topics/posts?I think that's what the OP is interested in, as am I (not sure what title/content means). Edited July 9, 20159 yr by Arai
July 9, 20159 yr Author When you create/edit the field in the ACP, there's a field called "Display format". Enter something like:<strong>{title}:</strong> {content}You can customize this as you see fit.Thanks Rikki, but that's not exactly what I mean. All the custom fields are displayed using this bit:{template="customFieldsDisplay" group="global" app="core" params="$comment->author()"} But it lists ALL the exisiting custom fields in a list. This is very inconvenient and very limiting.For example, I just created a custom field for members' Twitter accounts and I want to display it next to their username. How do I call that particular custom field? Edited July 9, 20159 yr by Kirill N
July 9, 20159 yr Sorry for hi-jacking, but Rikki what would it look like (full string) to have those fields displayed in the topics/posts? I think that's what the OP is interested in, as am I (not sure what title/content means). You'd enter exactly what I pasted - the {title} and {content} get replaced automatically when a user views a post
July 9, 20159 yr Author @Rikki In other words, is it possible to call one custom field instead of a list of all the existing ones?
July 9, 20159 yr @Rikki In other words, is it possible to call one custom field instead of a list of all the existing ones? Try something like this. Given a member object (in postContainer, it's $comment->author()), do: {{$fields = $comment->author()->profileFields();}} {$fields['core_pfieldgroups_<group_id>']['core_pfield_<field_id>']|raw} You'll need the ID of the field group and the field ID and insert them in the correct spot - you can find them in the AdminCP or by looking at your database
July 9, 20159 yr Author Try something like this. Given a member object (in postContainer, it's $comment->author()), do: {{$fields = $comment->author()->profileFields();}} {$fields['core_pfieldgroups_<group_id>']['core_pfield_<field_id>']|raw} You'll need the ID of the field group and the field ID and insert them in the correct spot - you can find them in the AdminCP or by looking at your database Worked like a charm, thanks a lot Rikki!
July 9, 20159 yr Are you just trying to display custom profile field information in the left hand user pane in a topic? If so then it's just a matter of entering in some code as per my post below. Check out the code I'm using in "Display format". I use similar code to display a number of custom profile fields e.g. software version:
July 9, 20159 yr Author Are you just trying to display custom profile field information in the left hand user pane in a topic? If so then it's just a matter of entering in some code as per my post below. Check out the code I'm using in "Display format". I use similar code to display a number of custom profile fields e.g. software version: Not quite.
July 10, 20159 yr Author @Rikki, how do I show the display format of the field, instead of raw?@Rikki ? (in case you missed it)
Archived
This topic is now archived and is closed to further replies.