This document is somewhat related to adding a custom signature below all of your posts: http://www.jivesoftware.com/jivespace/docs/DOC-5156 but it will allow you to easily specify custom profile field values to display in any discussion reply.
For example, say you have 2 custom profile field values that you've created and you want them to show up here:
A change like this will simply require some custom theming and it should be very quick and painless! Here is what you will need to do:
1) Create a new global theme (if you don't already have one)
2) Add the /template/forums/thread.ftl template to your global theme
3) Open the thread.ftl template up for editing and scroll down to the way bottom, pasting this macro in:
<#macro renderCustomProfileField fieldid user>
<#assign profile = jiveContext.getProfileManager().getProfile(user) />
<#if profile.get(fieldid?long)?exists>
<#assign profileFieldValue = profile.get(fieldid?long)>
<#assign profileField = jiveContext.getProfileFieldManager().getProfileField(fieldid?long) />
${profileField.name}:
<#if profileFieldValue.value?exists>
${profileFieldValue.value?html}
<#elseif profileFieldValue.values?exists>
<#list profileFieldValue.values as value>
${value?html}<#if value_has_next>,</#if>
</#list>
<#else>
Empty
</#if>
</#if>
</#macro>
If you want to change how the profile fields show up, this is what you will want to go back and modify.
4) Scroll up inside the same template to the following code:
<div class="jive-author">
<#if !message.user.anonymous>
<span class="jive-author-avatar-container">
<@jive.userAvatar user=message.user size=46 class='jive-avatar'/>
<#if statusLevelEnabled>
<@jive.userStatusLevel user=message.user/>
</#if>
</span>
<div class="jive-username-link-wrapper">
<@jive.userDisplayNameLink user=message.user />
</div>
<em>${jiveContext.getForumManager().getUserMessageCount(message.user)} <@s.text name="forum.thrd.posts_since.label"/> <br/>${message.user.creationDate?date}</em>
<#else>
<span class="jive-author-avatar-container">
<@jive.userAvatar user='' size=46 class='jive-avatar'/>
</span>
<div class="jive-username-link-wrapper">
<span class="jive-guestname"><@renderGuestDisplayName message=message/></span>
</div>
</#if>
</div>
and change it so it looks like this:
<div class="jive-author">
<#if !message.user.anonymous>
<span class="jive-author-avatar-container">
<@jive.userAvatar user=message.user size=46 class='jive-avatar'/>
<#if statusLevelEnabled>
<@jive.userStatusLevel user=message.user/>
</#if>
</span>
<div class="jive-username-link-wrapper">
<@jive.userDisplayNameLink user=message.user />
</div>
<em>${jiveContext.getForumManager().getUserMessageCount(message.user)} <@s.text name="forum.thrd.posts_since.label"/> <br/>${message.user.creationDate?date}<br/><br/>
<@renderCustomProfileField fieldid=5001 user=message.user /><br/>
<@renderCustomProfileField fieldid=5002 user=message.user />
</em>
<#else>
<span class="jive-author-avatar-container">
<@jive.userAvatar user='' size=46 class='jive-avatar'/>
</span>
<div class="jive-username-link-wrapper">
<span class="jive-guestname"><@renderGuestDisplayName message=message/></span>
</div>
</#if>
</div>
As you can see, the <em> tag was extended down to include the two custom profile fields (<@renderCustomProfileField fieldid=5001 user=message.user /> and <@renderCustomProfileField fieldid=5002 user=message.user />).
You can add as many custom profile field displays as you want to here, just swap out my profile field IDs (5001, 5002) with your own profile field IDs and everthing should get hooked up correctly:
You will need to repeat step 4 for the following code as well (the code in #4 is for the initial post but not the replies):
<div class="jive-author">
<#if !message.user.anonymous>
<span class="jive-author-avatar-container">
<@jive.userAvatar user=message.user size=46 class='jive-avatar'/>
<#if statusLevelEnabled>
<@jive.userStatusLevel user=message.user/>
</#if>
</span>
<div class="jive-username-link-wrapper">
<@jive.userDisplayNameLink user=message.user />
</div>
<em>${jiveContext.getForumManager().getUserMessageCount(message.user)} <@s.text name="forum.thrd.posts_since.label"/> <br/>${message.user.creationDate?date}<br/><br/>
<@renderCustomProfileField fieldid=5004 user=message.user /><br/>
<@renderCustomProfileField fieldid=5005 user=message.user />
</em>
<#else>
<span class="jive-author-avatar-container">
<@jive.userAvatar user='' size=46 class='jive-avatar'/>
</span>
<div class="jive-username-link-wrapper">
<span class="jive-guestname"><@renderGuestDisplayName message=message/></span>
</div>
</#if>
</div>
If you want this to display for other content types/other places on the thread page you should be able to jsut move around the <@renderCustomProfileField > calls and the display will move along with it. Enjoy!
-Todd

