MonoX support board

Start the conversation, ask questions and share tips and solutions with fellow developers.

Non-registered users can only browse through our support boards. Please register now if you want to post your questions. It takes a second and it is completely free. Alternatively, you can log in without registration using your credentials at major sites such as Google, Microsoft Live, OpenId, Facebook, LinkedIn or Yahoo.

Blog webpart  (Mono Support )

Viewed 28516 time(s), 6 post(s) 9/16/2013 6:57:14 PMby darryljneil
darryljneil

darryljneil

9/16/2013 6:57:24 PM
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!
Rated 5.00, 1 vote(s). 
207 Reputation 23 Total posts
mzilic

mzilic

9/17/2013 1:07:41 PM
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
Rated 5.00, 1 vote(s). 
2218 Reputation 300 Total posts
darryljneil

darryljneil

9/17/2013 8:41:28 PM
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
Rated 5.00, 1 vote(s). 
207 Reputation 23 Total posts
mzilic

mzilic

9/18/2013 8:51:23 AM
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
Rated 5.00, 1 vote(s). 
2218 Reputation 300 Total posts
darryljneil

darryljneil

9/18/2013 2:39:40 PM
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?
Rated 5.00, 1 vote(s). 
207 Reputation 23 Total posts
mzilic

mzilic

9/19/2013 9:02:08 AM
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
This content has not been rated yet. 
2218 Reputation 300 Total posts