> Forums > Active Social > Integration and API > Member Badges - Almost Working with XMod Pro - How Can I Integrate into Profile View
Last Post 16 Nov 2011 08:52 AM by Cliff Hammock. 4 Replies.
AddThis - Bookmarking and Sharing Button Printer Friendly
  •  
  •  
  •  
  •  
  •  
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
Not Resolved
Cliff Hammock
Customers
Cliff Hammock
Post Count:667

--
13 Nov 2011 01:16 PM
    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

    1. So I created a RoleGroup specifically for Badges and a few roles that I want to assign to my members.
    2. 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.
    3. 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>&nbsp;
    <listdatasource commandtext="Exec GetRoleIconsByUserByRoleGroup @UserID, @PortalID, @RoleGroupID">&nbsp;&nbsp;&nbsp;
    <parameter name="UserID" alias="UserID" value="[[Url:asuid]]">&nbsp;&nbsp;&nbsp;
    <parameter name="PortalID" alias="PortalID" value="0">&nbsp;&nbsp;&nbsp;
    <parameter name="RoleGroupID" alias="RoleGroupID" value="2"> &nbsp;&nbsp; </parameter>
    </parameter>
    </parameter>
    </listdatasource>
    &nbsp; <detaildatasource>&nbsp;
    <headertemplate>
    &nbsp; &nbsp;
    </headertemplate>
    &nbsp; <itemtemplate>&nbsp;&nbsp;&nbsp; <span><img alt="" style="border-width: 0px; border-style: solid;" src="http://www.activemodules.com/portals/0/icons/[[FileName]]" /></span>&nbsp; </itemtemplate>&nbsp; <footertemplate>&nbsp;&nbsp; &nbsp;&nbsp; </footertemplate>&nbsp; <detailtemplate>&nbsp;&nbsp; &nbsp;&nbsp; </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.


    BadgesInProfile11-13-2011_2-03-08_PM.jpg

    Cliff Hammock
    Customers
    Cliff Hammock
    Post Count:667

    --
    15 Nov 2011 01:38 PM
    Bump... hoping to get some info on how to get my badges into the correct spot on my profile page.


    Jeff Blanks
    Customers
    Jeff Blanks
    Post Count:387

    --
    15 Nov 2011 07:55 PM
    Cliff,

    You obviously know I dont have xmp yet, but I have made some headway with AF on this.

    AF uses the token [AF:Roles:Administrators;Registered Users;Etc;Etc].

    I just worked this out for AF by using that token in my postinfo template with something like this:
    < span class="siteroles [AF:Roles:Administrators;Registered Users;Etc;Etc]" >< /span >

    Then I create the corresponding css for each role IE .siteroles.Registered.Users, and add an image as the background. Works pretty good.

    I've also tried to expand it into AS by using the AF template loader without success because the darned AF control doesn't recognize that token.

    I've even gone as far as reviewing all of the AS tokens and even trying to use the account info tab tokens in a custom view, because it does show the user roles, but I'm still unsuccessful.

    Not an optimal solution, but you could use jQuery to take a specific id out of context and move it above or below another id.

    Ex: jQuery(‘#myroleid’).insertBefore(‘#contentaftermyprofileimage’);


    Cheers! Jeff
    @northeastok | @jeffblanks | My Blog
    Jeff Blanks
    Customers
    Jeff Blanks
    Post Count:387

    --
    15 Nov 2011 07:58 PM
    You could probably move the whole output of the moduleid by doing it with jquery. Then you wouldn't have to worry about hiding any of the outputted module content on the page, since the whole thing is being move.

    Except for maybe hiding the container in module settings. That would strip the code down a bit for you.


    Cheers! Jeff
    @northeastok | @jeffblanks | My Blog
    Cliff Hammock
    Customers
    Cliff Hammock
    Post Count:667

    --
    16 Nov 2011 08:52 AM
    Wow, I feel really stupid now. I knew this had to be an easy solution, but didn't realize how easy. I just kept poking around the forums and I saw that Will Sugg referenced the active:moduleloader in a related posted. Then I realized I can inject any module anywhere in the profileview.ascx using that. I just put the XMP badges modules on another page with no container displaying, and then loaded it directly above the active:memberlist in the profileview.ascx. See the code and screenshot below. As I mentioned before, these are just placeholder badge images until I get the badge icons done for my site.


    
    <div style="text-align: left;"><active:moduleloader id="ctlMyBadges" tid="86" mid="578" runat="server"> </active:moduleloader></div>
    &nbsp;&nbsp; 


    BadgesWorking11-16-2011_9-46-05_AM.jpg

    You are not authorized to post a reply.
    > Forums > Active Social > Integration and API > Member Badges - Almost Working with XMod Pro - How Can I Integrate into Profile View
    test
    Copyright 2012 by DotNetNuke Corporation / Terms of Use / Privacy