0 Replies Latest reply on Jan 12, 2010 5:33 PM by scott.finkel

    Accessing Individual Custom Profile Attributes?

    scott.finkel

      We have successfully added a custom attribute of type Number, called "Extension" and mapped it appropriately to the LDAP field we need. I've read through the code, and understand how things are routed to profile-macros.ftl & the displayProfileFields macro. I also see there that I can use field.name to stop the rendering of fields, and this works with Custom fields as well. (line 619 of profile-macros.ftl)

       

      What I'd like to do it assign the value of the Extension field to a variable, and then refer to that in my view-profile.ftl - effectively moving the Extension field out of the list it is currently in. (This is part of a larger effort to redefine the look & feel of the profile page.)

       

      Below is some code I've added to the displayProfileField macro in my theme's profile-macros.ftl. The #if works. I cannot seem to find the right combination of references to set the qcExtension value, however. (the <dt> & <dd> here are just for debugging - I'm hoping that since profile-macros.ftl is called by view-profile.ftl that I will be able to reuse the var there to position the extension wherever I'd like. True? False?)

       

      What is the proper way to access an individual custom field's value?

       

       

              <#if (field.name == "Extension")>
                  <#assign qcExtension = ????>
                  <dt>x</dt>
                  <dd>${qcExtension!?html}</dd>
              </#if>

       

      I've searched the documentation, (and the discussions) but have not found any good reference for things of this nature. If there is reference material which calls out the different methods exposed from the java and how they are mapped to the freemarker code, please let me know.

       

      Thanks.