Adding a website link to the Member Directory in DotNetNuke 6.2

In case you missed it, DotNetNuke 6.2 was released today, check out Will Morgenweck’s blog post for more details on the release.

With some of the new features DotNetNuke 6.2 makes it easier to start to customize the listing of members on your site, and also the Profile display for users on the website. I started implementing DotNetNuke 6.2 on one of my racing websites last night (yeah, so I upgraded before the release happened, a benefit of working for the corp Winking smile).

In doing so I configured the profile pages on the website to use some of the new 6.2 functionality, before I show you the code, here’s a link to my profile over there, so you can see what all I implemented. This is far from complete, plenty of more work to be done, but it provides far more information than the profiles did two days ago.

http://www.sccaforums.com/user-profile/userid/37959

Now for the code itself. This code gets included in the ViewProfile module as the profile template, this was what I put in last night.

<div class="pBio">
    <h3 data-bind="text: AboutMeText"></h3>
    <p data-bind="html: Biography"></p>
</div>
<div class="pAddress">
    <h3 data-bind="text: LocationText"></h3>
    <p>    <span data-bind="text: Location()"></span><span 
data-bind="visible: Location().length > 0"><br/></span> <span data-bind="text: Country()"></span><span data-bind="visible: Country().length > 0"><br/></span> </p> </div> <div class="pContact"> <h3 data-bind="text: GetInTouchText"></h3> <ul> <li data-bind="visible: Website().length > 0"><strong><span
data-bind="text: WebsiteText">:</strong> <span data-bind="text: Website()"></li> </ul> </div> <div class="dnnClear"></div>

That will show some basic information for a user’s profile. One thing I wanted to do was to make the Website option an actual hyperlink, as you can see in that display it isn’t right now. To do so is fairly straight forward, in place of that line, we would use the following code

<li data-bind="visible: Website().length > 0"><strong><span 
data-bind="text: WebsiteText">:</strong> <a href="" title="" class="profWebsite"
data-bind="attr: { title: Website(), href: Website() }" rel="nofollow" target="_blank">
<span data-bind="text: Website()"></span></a></li>

Basically we’re using Knockout.js to bind the Website information from the User’s Profile, to
the hyperlink, for both the href and title value, then spitting out the Website attribute as the text of the hyperlink as well. For SEO purposes I put a rel=”nofollow” in there to prevent search engines from giving the profile links any weight, you could always change that if you wish.

In addition to that information, I always wanted to enable a “send me an email” link, that pointed to the new Messaging Center in DNN 6.2. That wasn’t quite as easy as adding the Hyperlink to the Profile page, but it was pretty straightforward (to be honest I just ripped off the code from the Default “template” in DotNetNuke 6.2, but that is the beauty of open source. To add the Message link, as well as a “Friend” and “Follow” link I used the following code

<div data-bind="visible: !IsUser() && IsAuthenticated">
    <ul>
        <li><a href="" title="" class="ComposeMessage"><span data-bind="text: SendMessageText">
        </span></a></li>
        <li><span><a href="" data-bind="click: addFriend, visible: FriendStatus() == 0"><span
            data-bind="text: AddFriendText"></span></a><span
data-bind="click: addFriend, visible: IsPending()"> <span data-bind="text: FriendPendingText"></span></span><a href=""
data-bind="click: acceptFriend, visible: HasPendingRequest()"> <span data-bind="text: AcceptFriendText"></span></a><a href=""
data-bind="click: removeFriend, visible: IsFriend()"> <span data-bind="text: RemoveFriendText"></span></a></span></li> <li><span><a href="" data-bind="click: follow, visible: !IsFollowing()"><span
data-bind="text: FollowText"> </span></a><a href="" data-bind="click: unFollow, visible: IsFollowing()"><span
data-bind="text: UnFollowText"> </span></a></span></li> </ul> </div>

But I didn’t add it to the ViewProfile module. Instead you need to place the Member Directory module on a page, set the above code as the Item and Alternate Item template.

You can see the Member Directory module in action in this “Using the Member Directory in DotNetNuke 6.2” video.

14 Comments

  • Hi there! Someone in my Facebook group shared this site with us so I came to check it out.

    I'm definitely loving the information. I'm book-marking and will be tweeting this to my followers! Fantastic blog and wonderful design and style.

  • Appreciate your comment. I've bookmarked your website in my browser to follow-up with this weekend. Looking forward to the next post.

  • I just like the helpful info you provide in your articles.

    I will bookmark your weblog and take a look at again here regularly.

    I'm reasonably sure I will be informed plenty of new stuff proper right here! Good luck for the following!

  • Wow, marvelous blog layout! How long have

    you been blogging for? you made blogging look easy.

    The overall look of your site is great, as well as the content!

  • I've been surfing online more than three hours today, yet I never found any interesting article like yours. It's pretty worth enough for me. In my opinion, if all webmasters and bloggers made good content as you did, the net will be a lot more useful than ever before.

  • I blog often and I really thank you for your information.

    This article has truly peaked my interest.

    I will take a note of your website and keep checking for new details about once per week.

    I subscribed to your RSS feed too.

  • This info is invaluable. Where can I find out more?

  • Hubbard you can find out more at http://www.dotnetnuke.com

  • I just could not leave your web site before suggesting that I actually loved the

    standard information an individual provide for your guests?

    Is gonna be again regularly to check up on new posts

  • I have read so many content on the topic of the blogger lovers but this

    article is genuinely a good paragraph, keep it up.

  • foruntaly that is really a good idea more savii

  • Woah! I'm really enjoying the template/theme of this site. It's simple, yet effective. A lot of times it's challenging to get that &quot;perfect balance&quot; between superb usability and appearance. I must say that you've done a superb job with this. In addition, the blog loads very fast for me on Internet explorer. Superb Blog!

  • Hi,

    Is there a way to share member information across sites? So if I have 2 sites with members, can I search through the profiles of BOTH site from any one site?

    Thanks for your help,
    Prashant

  • Sharing members across sites is a feature of the Professional and Enterprise editions of dnn

Comments have been disabled for this content.