Kirill N Posted February 18, 2015 Share Posted February 18, 2015 I have created a custom field, how do I display it's value in post bit? Link to comment Share on other sites More sharing options...
Kirill N Posted February 18, 2015 Author Share Posted February 18, 2015 Link to comment Share on other sites More sharing options...
Kirill N Posted July 9, 2015 Author Share Posted July 9, 2015 Bump... Link to comment Share on other sites More sharing options...
Arai Posted July 9, 2015 Share Posted July 9, 2015 Do you mean this: https://community.invisionpower.com/topic/417661-profile-fields-in-posttopic/ ? Link to comment Share on other sites More sharing options...
Rikki Posted July 9, 2015 Share Posted July 9, 2015 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. Link to comment Share on other sites More sharing options...
Arai Posted July 9, 2015 Share Posted July 9, 2015 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). Link to comment Share on other sites More sharing options...
Kirill N Posted July 9, 2015 Author Share Posted July 9, 2015 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? Link to comment Share on other sites More sharing options...
Rikki Posted July 9, 2015 Share Posted July 9, 2015 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 Link to comment Share on other sites More sharing options...
Kirill N Posted July 9, 2015 Author Share Posted July 9, 2015 @Rikki In other words, is it possible to call one custom field instead of a list of all the existing ones? Link to comment Share on other sites More sharing options...
Rikki Posted July 9, 2015 Share Posted July 9, 2015 @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 Link to comment Share on other sites More sharing options...
Kirill N Posted July 9, 2015 Author Share Posted July 9, 2015 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! Link to comment Share on other sites More sharing options...
Kirill N Posted July 9, 2015 Author Share Posted July 9, 2015 @Rikki, how do I show the display format of the field, instead of raw? Link to comment Share on other sites More sharing options...
3DKiwi Posted July 9, 2015 Share Posted July 9, 2015 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: Link to comment Share on other sites More sharing options...
Kirill N Posted July 9, 2015 Author Share Posted July 9, 2015 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. Link to comment Share on other sites More sharing options...
Kirill N Posted July 10, 2015 Author Share Posted July 10, 2015 @Rikki, how do I show the display format of the field, instead of raw?@Rikki ? (in case you missed it) Link to comment Share on other sites More sharing options...
Kirill N Posted July 15, 2015 Author Share Posted July 15, 2015 Bump @Rikki Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.