0 Replies Latest reply on Sep 27, 2012 10:23 AM by Jessefrankling

    Is it possible to call custom profile fields by Field name instead of ID

    Jessefrankling

      I'm currently going off of a previous thread about including custom field values into a FTL.

       

      <#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) />

                <tr>

                     <td>${profileField.name}:</td>

              <#if profileFieldValue.value?exists>

                     <td> ${profileFieldValue.value?html}</td>

                </tr>

              <#elseif profileFieldValue.values?exists>

                  <#list profileFieldValue.values as value>

                      ${value?html}<#if value_has_next>,</#if>

                  </#list>

              <#else>

                  Empty

              </#if>

          </#if>

      </#macro>

       

       

      <@renderCustomProfileField fieldid=5003 user=targetUser />

       

      This works great my only problem is we have Jive installed on several environments and will be passing the code off to the client to be installed in the final production environment. Is there a way to call the custom fields by the Field Names?