Chris Hammond

DotNetNuke Upgrade and Consulting specialist

News

Thanks for visiting my blog, you can find more about me at ChrisHammond.com. I specialize in all things DotNetNuke

Cool Sites

My domains

Projects

Archives

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.

Comments

Macdonald said:

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.

# May 30, 2012 8:26 AM

Scarborough said:

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

# May 30, 2012 8:32 AM

Ware said:

This is very interesting, You are a very skilled blogger.

I've joined your feed and look forward to seeking more of your fantastic post. Also, I've shared your website in my social networks!

# May 30, 2012 10:16 AM

Greiner said:

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!

# May 30, 2012 10:43 AM

Witcher said:

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!

# May 30, 2012 1:52 PM

Luciano said:

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.

# May 30, 2012 2:02 PM

Shay said:

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.

# May 30, 2012 4:22 PM

Hubbard said:

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

# May 30, 2012 6:23 PM

Chris Hammond said:

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

# May 30, 2012 7:31 PM

Tiffany said:

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

# May 31, 2012 1:22 AM

Conner said:

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

article is genuinely a good paragraph, keep it up.

# May 31, 2012 3:59 AM

Gynccikephype said:

foruntaly that is really a good idea more savii

# June 2, 2012 12:43 AM

Brand said:

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 "perfect balance" 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!

# June 2, 2012 5:26 PM

Prashant said:

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

# June 22, 2012 3:41 PM

Chris Hammond said:

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

# June 22, 2012 3:46 PM