I put together a few things from other members and now I can display badges on a member profile. Steven Webster posted a SPROC on this thread that returns the Icon files for a role. Until I saw that thread I really had not thought about something as simple as using the IconFile from the Role.
http://www.activemodules.com/active...ile/#22917
- So I created a RoleGroup specifically for Badges and a few roles that I want to assign to my members.
- I assigned a couple of roles to my profile and another role to another profile to make sure it is pulling the correct roles by the profile asuid and not the logged in userid.
- Then I took Will Sugg's lead on using XMod Pro to get and display the badges. XMP lets me create a display template with a ListDataSource that can execute the SPROC Steven provided and return the RoleIcons. Further XMP allows me to Get a URL Parameter. So I am pulling the ASUID parameter from the URL (works even with vanity names implemented) and the SPROC filters on ASUID, PORTALID, and ROLEGROUPID.
There was a little learning curve for me on XMP, but once I found Steven's SPROC I knew exactly what to do. Here is the XMP code.
<xmod:template>
<listdatasource commandtext="Exec GetRoleIconsByUserByRoleGroup @UserID, @PortalID, @RoleGroupID">
<parameter name="UserID" alias="UserID" value="[[Url:asuid]]">
<parameter name="PortalID" alias="PortalID" value="0">
<parameter name="RoleGroupID" alias="RoleGroupID" value="2"> </parameter>
</parameter>
</parameter>
</listdatasource>
<detaildatasource>
<headertemplate>
</headertemplate>
<itemtemplate> <span><img alt="" style="border-width: 0px; border-style: solid;" src="http://www.activemodules.com/portals/0/icons/[[FileName]]" /></span> </itemtemplate> <footertemplate> </footertemplate> <detailtemplate> </detailtemplate></detaildatasource></xmod:template>
My question now is how do I get the XMP module to display under my profile image by integrating it into in my profileview.ascx? Or is there another way?
Thanks to everyone who helped me get this far. Hopefully getting the icons to display in the profileview will be straightforward. See an attached image that shows the icons displaying above the profile, since I just have my XMP module sitting at the top of the content pane. Also, these are not my final Badge icons, they are just placeholder images for now.