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 )

12463 put(a) pogledan, 3 odgovor(a) 20.9.2011. 7:38:07Kreirao(la) Maxim
Maxim

Maxim

20.9.2011. 7:38:07
Hi. How I can to allow user to create and populate this personal blog?
Ovaj sadržaj još nije ocijenjen. 
319 Reputacija 30 Ukupno objava
imarusic

imarusic

20.9.2011. 8:21:29
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
Ocjena 5,00, 1 glas(ova). 
3016 Reputacija 428 Ukupno objava
Maxim

Maxim

23.9.2011. 12:58:26
thanks for you answer!
Can you explain me step 1 a little bit more. :) How I can to modify existing page?
Ovaj sadržaj još nije ocijenjen. 
319 Reputacija 30 Ukupno objava