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.

Is it possible to display "About me" information along with the author image in Blog details page ?  (Mono Support )

10779 put(a) pogledan, 8 odgovor(a) 5.9.2012. 14:18:54Kreirao(la) super
super

super

5.9.2012. 14:18:54
Is it possible to display "About me" information along with the author image in Blog details page ?

If yes, Please explain how can i achieve this ?
Ovaj sadržaj još nije ocijenjen. 
6018 Reputacija 709 Ukupno objava
mzilic

mzilic

5.9.2012. 19:22:43
Hello,

I'm assuming you mean the BlogPostView? The approach which I recommend requires some custom coding.
1. You need to edit the BlogPost.ascx template to add your own custom tag, for example:
<# AboutMe #>
2. In your custom project you need to inherit the BlogPostView control and override its ParseBlogPostTemplateTags method. This is where you should insert your custom logic, you should fetch the UserProfileEntity and add the AboutMe section in the Hashtable, for example:
var tags = base.ParseBlogPostTemplateTags(post, maxTitleChars, maxDescriptionChars, dateFormatString);
tags.Add("<# AboutMe #>", profile.AboutMySelf);
3. Inherit the BlogContainer control and copy the default markup. Change the path of the BlogPostView to point towards your custom control.
4. Inherit Blog.aspx and copy the default markup. Change the path of the BlogContainer to point towards your custom control.
5. Change web.config URL rewriting rules to point towards your custom Blog page.

Regards,
Mario
Ovaj sadržaj još nije ocijenjen. 
2218 Reputacija 300 Ukupno objava
super

super

14.1.2013. 21:34:47
Mario,

Since I don't have any .cs file (as monox is prebuild) - How am I supposed to do this ?

Also I am not able to understand how to go about it from step 2 onwards - could you please give me detailed steps PLEASE ? what to do and where to do ?
Ovaj sadržaj još nije ocijenjen. 
6018 Reputacija 709 Ukupno objava
mzilic

mzilic

14.1.2013. 21:55:25
Hello,

The process described here is intended for people without the source code. Can you be more specific as to what exactly is unclear to you?

Regards
Ovaj sadržaj još nije ocijenjen. 
2218 Reputacija 300 Ukupno objava
super

super

14.1.2013. 23:12:24
2. In your custom project you need to inherit the BlogPostView control and override its ParseBlogPostTemplateTags method. This is where you should insert your custom logic, you should fetch the UserProfileEntity and add the AboutMe section in the Hashtable, for example:
var tags = base.ParseBlogPostTemplateTags(post, maxTitleChars, maxDescriptionChars, dateFormatString);
tags.Add("<# AboutMe #>", profile.AboutMySelf);

Request: I don't have any logic requirement - All I need is that when user clicks any blog post and in the blog post content page, at the bottom of the blog post, it should display "About me" info about the author of the blog post.

I don't know where to add this code ? It can't go in ascx file...this looks like .cs code...
var tags = base.ParseBlogPostTemplateTags(post, maxTitleChars, maxDescriptionChars, dateFormatString);
tags.Add("<# AboutMe #>", profile.AboutMySelf);




3. Inherit the BlogContainer control and copy the default markup. Change the path of the BlogPostView to point towards your custom control.
Request: Could you please show me with an example ? I don't have any custome blogcontainer right now - I am trying to make changed in the original BlogContainer...


4. Inherit Blog.aspx and copy the default markup. Change the path of the BlogContainer to point towards your custom control.
Request: Since I am making changes in the original BlogContainer so I am assuming I don't need to point anything to the custom control...
What default markups you are talking about ?

5. Change web.config URL rewriting rules to point towards your custom Blog page.
Request: Where in web.config - what's the exact location ? where am I looking in config file ?
Ovaj sadržaj još nije ocijenjen. 
6018 Reputacija 709 Ukupno objava
khorvat

khorvat

15.1.2013. 9:34:11
Hi Super,

just a tip on the following:
2. In your custom project you need to inherit the BlogPostView control and override its ParseBlogPostTemplateTags method. This is where you should insert your custom logic, you should fetch the UserProfileEntity and add the AboutMe section in the Hashtable, for example:
var tags = base.ParseBlogPostTemplateTags(post, maxTitleChars, maxDescriptionChars, dateFormatString);
tags.Add("<# AboutMe #>", profile.AboutMySelf);
 
Request: I don't have any logic requirement - All I need is that when user clicks any blog post and in the blog post content page, at the bottom of the blog post, it should display "About me" info about the author of the blog post.
 
I don't know where to add this code ? It can't go in ascx file...this looks like .cs code...
var tags = base.ParseBlogPostTemplateTags(post, maxTitleChars, maxDescriptionChars, dateFormatString);
tags.Add("<# AboutMe #>", profile.AboutMySelf);
You can just put the following in your template file: "$Container.DataItem.AspnetUser.UserProfile.AboutMySelf" and use the built in support for NVelocity templating.

In this scenario I think that all this control / markup inheritance in not neccessary, Mario can you please confirm ?

Regards
Ovaj sadržaj još nije ocijenjen. 
15993 Reputacija 2214 Ukupno objava
super

super

15.1.2013. 16:16:53
Khorvat,

You mean in App_Templates/ Default / BlogTemplates / BlogPost.ascx

I should do like this ?

<div class="blog-item xfolkentry">
<div class="avatar">
<a href="<# AuthorProfile #>"><# Avatar #></a>
<a href="<# AuthorLink #>" class="author"><# Author #></a></span>
<div class="arrow"></div>
</div>
<div class="content <# UnpublishedClass #>">
<h2>
<span class="date"><# PubDate #></span>
<# Title #>
</h2>
<p>
<# Categories #>
<# AuthorOtherArticlesLabel #><a href="<# AuthorLink #>"><# Author #></a> <a href="<# AuthorProfile #>"><# AuthorFullName #></a>
</p>
<p><# Content #></p>
<div><# Files #></div>

<div><# $Container.DataItem.AspnetUser.UserProfile.AboutMySelf #></div>

<div class="tags"><# Tags #></div>
<div><# Rating #></div>
<div class="options clearfix">
<span class="float-left">
<# Edit #>
<# Delete #>
<# DeleteUnapproved #>
<# DeleteSpam #>
<# Publish #>
<# Email #>
<# Comments #>
</span>
<span class="float-right"><# TellAFriend #></span>
</div>
</div>
</div>
Ovaj sadržaj još nije ocijenjen. 
6018 Reputacija 709 Ukupno objava
khorvat

khorvat

17.1.2013. 8:12:39
No you just need to add it like this:

<div class="blog-item xfolkentry">
<div class="avatar">
<a href="<# AuthorProfile #>"><# Avatar #></a>
<a href="<# AuthorLink #>" class="author"><# Author #></a></span>
<div class="arrow"></div>
</div>
<div class="content <# UnpublishedClass #>">
<h2>
<span class="date"><# PubDate #></span>
<# Title #>
</h2>
<p>
<# Categories #>
<# AuthorOtherArticlesLabel #><a href="<# AuthorLink #>"><# Author #></a> <a href="<# AuthorProfile #>"><# AuthorFullName #></a>
</p>
<p><# Content #></p>
<div><# Files #></div>
 
<div>$Container.DataItem.AspnetUser.UserProfile.AboutMySelf</div>
 
<div class="tags"><# Tags #></div>
<div><# Rating #></div>
<div class="options clearfix">
<span class="float-left">
<# Edit #>
<# Delete #>
<# DeleteUnapproved #>
<# DeleteSpam #>
<# Publish #>
<# Email #>
<# Comments #>
</span>
<span class="float-right"><# TellAFriend #></span>
</div>
</div>
</div>
Without the <# & #>.

Regards
Ovaj sadržaj još nije ocijenjen. 
15993 Reputacija 2214 Ukupno objava