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.

Personal Blog  (Mono Support )

Viewed 11589 time(s), 3 post(s) 9/20/2011 7:38:07 AMby Maxim
Maxim

Maxim

9/20/2011 7:38:07 AM
Hi. How I can to allow user to create and populate this personal blog?
This content has not been rated yet. 
319 Reputation 30 Total posts
imarusic

imarusic

9/20/2011 8:21:29 AM
Hi Maxim,

you have to create a blog for each user during the account creation. To do so you need to attach to membershipEditor AccountCreated event on registration page. Below is a code snippet:

1. Put this in Registration page init method.
ctlMembershipEditor.AccountCreated += new MonoSoftware.MonoX.ModuleGallery.MembershipModuleEvent(ctlMembershipEditor_AccountCreated);

2. This code will create a blog for user.
void ctlMembershipEditor_AccountCreated(object sender, MonoSoftware.MonoX.ModuleGallery.MembershipModuleEventArgs e)
{
            BlogEntity blog = new BlogEntity(GuidExtension.NewSequentialGuid());
            blog.Name = e.MembershipUser.UserName;
            blog.Slug = UrlSeoOptimizer.GetOptimizedString(blog.Name);
            blog.DateCreated = DateTime.Now;
            blog.UserId = new Guid(e.MembershipUser.ProviderUserKey.ToString());
            blog.ApplicationId = MembershipRepository.GetInstance().GetApplicationId();
            blog.LanguageId = LocalizationUtility.GetCurrentLanguageId();
 
            MonoXCacheManager cacheManager = MonoXCacheManager.GetInstance();
            cacheManager.RemoveAll(CacheKeys.Blog.Root);
            cacheManager.RemoveAll(CacheKeys.Blog.Editors);
 
            using (BlogRepository rep = BlogRepository.GetInstance())
                rep.SaveBlog(blog);
}


After user account creation you can navigate to your blog page with the following url:

/blog/posts/username/


Regards
Rated 5.00, 1 vote(s). 
3016 Reputation 428 Total posts
Maxim

Maxim

9/23/2011 12:58:26 PM
thanks for you answer!
Can you explain me step 1 a little bit more. :) How I can to modify existing page?
This content has not been rated yet. 
319 Reputation 30 Total posts