Mono Support Blog webpart 

Viewed 31328 time(s), 6 post(s), 9/16/2013 6:57:14 PM - by darryljneil
9/16/2013 6:57:24 PM
207 Reputation 23 Total posts

I'm looking to find a way to control where the Blog directs a user when clicking on the picture of the user who entered the blog. It looks like it redirects to a MonoX page that shows User Profile information. Can this be modified? If so, how?

Also, it looks like there is a template file for the BlogPost, but I can't find how it's being applied. Could the use of this be elaborated on?

Thanks for any help!

1
9/17/2013 1:07:41 PM
2218 Reputation 300 Total posts

Hello,

I can recommend two options:
1. Modify the MonoX's default profile rewrite rule in web.config to point towards your own profile page.

2.a) In your custom project you need to inherit the BlogPostView control and override its ParseBlogPostTemplateTags method. This is where you could insert your custom logic, you need to change change the AuthorProfile tag contents, ex:

tags["<# AuthorProfile #>"] = "myNewUrl";
b) Inherit the BlogContainer control and copy the default markup. Change the path of the BlogPostView to point towards your custom control.
c) Inherit Blog.aspx and copy the default markup. Change the path of the BlogContainer to point towards your custom control.
d) Change web.config URL rewriting rules to point towards your custom Blog page.

Regards,
Mario

2
9/17/2013 8:41:28 PM
207 Reputation 23 Total posts

Mario, I took your suggestion and implemented the first strategy you outlined (1. Modify the MonoX's default profile rewrite rule in web.config to point towards your own profile page.). The blog container/view/post or whatever it is called now takes me to a page that I have explicitly defined.
The issue I'm having now is upon clicking the Profile pic and redirecting to the "Wall" page I've created, the profile for the currently logged in user is displayed, instead of the user whose profile pic I clicked on. What could I be overlooking at this point?

Thanks again,
Darryl

3
9/18/2013 8:51:23 AM
2218 Reputation 300 Total posts

Hello,

The issue I'm having now is upon clicking the Profile pic and redirecting to the "Wall" page I've created, the profile for the currently logged in user is displayed, instead of the user whose profile pic I clicked on. What could I be overlooking at this point?
Your rewrite rule needs to take into consideration the username argument which is passed via query parameters. Using that query parameter you need to load the appropriate user profile and show it on your custom profile page.

Regards

4
9/18/2013 2:39:40 PM
207 Reputation 23 Total posts

Thank you. That sounds simple enough. One more question at this point. Is there method in the MonoX library to populate a user profile object based on username?

5
9/19/2013 9:02:08 AM
2218 Reputation 300 Total posts

UserProfileBLL exposes a GetCachedProfile method which you can use, this method accepts the UserId parameter however you can easily get the UserId using the SecurityUtility.GetUserId method overload which accepts the username as a parameter.

However if you extended the MonoX's user profile you'd need to fetch the additional tables for your own custom user profile. As for populating the data on the front-end controls, you can refer the following blog post about DataManager: http://www.mono-software.com/Blog/post/Mono/138/Using-Mono-DataManager/

Regards

6
This is a demo site for MonoX. Please visit Mono Software for more info.