This project is read-only.


Topics: Controls
Nov 13, 2010 at 1:57 PM

Two things about the Archives...I was just wondering how to archive the posts? I just checked through the Control Panel and did not see a tab for the archives. Also, how do I remove the column for the rating? My client doesn't want to show any ratings. Any help is as always, very appreciated. :-)


Nov 13, 2010 at 2:22 PM

BlogEngine does it automatically. You just link to the page.


<li><a href="<%=Utils.AbsoluteWebRoot %>archive.aspx"><%=Resources.labels.archive %></a></li>

Put the code above in your master page. BlogEngine does the rest.

"How do I remove the column for the rating?"

You mean at the very bottom of each post?

Currently rated 4.2 by 5 people


Take the following code out of your PostView.ascx file in the themes folder:


 <%=Rating %>

It should be near this:

<div class="text"><asp:PlaceHolder ID="BodyContent" runat="server" /></div>
  <div class="bottom">

    <%=Rating %>   <----- Take This Out

    <p class="tags">Tags: <%=TagLinks(", ") %></p>
    <p class="categories"><%=CategoryLinks(" | ") %></p>

Tried it on my site and it works.

Hopefully this is what you are talking about.

Nov 13, 2010 at 3:30 PM
Edited Nov 13, 2010 at 5:50 PM
"You mean at the very bottom of each post?"
No I mean on the Archive page there are four columns: Date, Title, Comments and Rating. My client does not want the Rating column.
I've already removed it from the bottom of each post.

Also, on the "Auto archive" - you say to insert the code shown and BlogEngine does the rest? Maybe I'm missing something here, first -
where within the masterpage do I insert the code? Also, there are only certain posts that she wants to archive, and she wants to archive
weekly, not monthly. sorry, but how do I set that?

Also, maybe we aren't talking apples to apples...The Archives page does list all the articles (posts) but, we need to clear the home page so that it
doesn't keep getting longer & longer with each day's post. This is what I mean about do I move the week's
worth of posts off the front or home page?


Nov 13, 2010 at 5:49 PM

Go to : admin/Widgets/Controls.aspx


Uncheck the Display rating

In theory it should work, but for me locally it does not I am using Powered by BlogEngine.NET

  • <label class="lbl" for="cphAdmin_txtNumberOfPosts">Number of posts</label> <input id="cphAdmin_txtNumberOfPosts" style="width: 30px;" name="ctl00$cphAdmin$txtNumberOfPosts" type="text" value="10" />
  • <input id="cphAdmin_cbDisplayComments" checked="checked" name="ctl00$cphAdmin$cbDisplayComments" type="checkbox" /> <label for="cphAdmin_cbDisplayComments">Display comments</label> <input id="cphAdmin_cbDisplayRating" name="ctl00$cphAdmin$cbDisplayRating" type="checkbox" /> <label for="cphAdmin_cbDisplayRating">Display rating</label>
  • Date Title Comments Rating<----Take this out
    2010-11-11 testing code 1




    The only way I got it to work for me is to take out this code:


    if (BlogSettings.Instance.EnableRating)
    			HtmlTableCell rating = new HtmlTableCell("th");
                rating.InnerHtml = Utils.Translate("rating");
    			rating.Attributes.Add("class", "rating");

    The source file is here:

    In your root directory is the archive.aspx.cs file


    At around line 189


    I know this is missing with the code but is the only way i could get it to work


    Nov 13, 2010 at 5:54 PM
    Edited Nov 13, 2010 at 5:58 PM

    Thanks so much kbdavis - I will try that to remove the ratings.

    I am still at a loss though on how to archive the daily posts on the home page on a weekly basis. If you check out her site:, you will see on the Homepage that there are two weeks worth of articles (posts) and the home page is getting oftly long... that is where I need to set the archive. Thanks!

    Nov 13, 2010 at 7:33 PM
    Edited Oct 24, 2011 at 10:25 PM

    I do not know how to do the archive on a weekly basis. But, I bit you have to put some code in the .cs file to do it.


    Java Blog

    Nov 13, 2010 at 11:51 PM

    Thanks kbdavis. I was able to get rid of the Ratings column by following your instructions, but I had to rem out two sections:

         if (BlogSettings.Instance.EnableRating)
          HtmlTableCell rating = new HtmlTableCell();
          rating.InnerHtml = post.Raters == 0 ? "None" : 
             Math.Round(post.Rating, 1).ToString();
            rating.Attributes.Add("class", "rating");
    if (BlogSettings.Instance.EnableRating) 
    { HtmlTableCell rating = new HtmlTableCell("th");
    rating.InnerHtml = Utils.Translate("rating");
    rating.Attributes.Add("class", "rating");


    Hopefully someone will have some insight on how to set the archive to weekly archives instead of monthly. Thanks very much for your help, it is very appreciated!


    Nov 14, 2010 at 3:08 PM

    Does anyone know how/where to change the archive date from monthly to weekly? Any help would be greatly appreciated.



    Nov 14, 2010 at 6:28 PM

    Coleen:  Which page or widget are you referring to?  It looks like you're talking about the Archive page, but the posts on there are broken down by Category.  And the date is shown next to each post (e.g. 2010-11-14).  There isn't anything on this page that looks like it is being shown "monthly".

    Nov 14, 2010 at 8:49 PM
    Edited Nov 14, 2010 at 8:49 PM

    Thanks Ben. Actually, I am referring to the Home page. As you can see, after about 4 or 5 days, the daily articles make the home page very long...My client wants to archive those daily posts once a week - that is, to not have them show on the home page, only when they are clicked on in the Archive page. Is there a way to do that? You know, like a "regular" blog allows for monthly archiving of the posts, and in some cases you can set the archive to be a certain number of days. I think she'd like to have her "Blog" archived on a weekly (every 7 days) basis. Is this possible? Thanks!

    Nov 14, 2010 at 8:58 PM

    I see.  First, as you may know, the number of posts that appear on the homepage (before needing to page to page 2, 3, etc) is controllable in the Settings area in the control panel.  The setting is "Posts per Page".  You can set it for 3, 4, 5, 10, 50, etc.

    You can make an adjustment in default.aspx.cs.  In Page_Load is currently this code:

    PostList1.Posts = Post.Posts.ConvertAll(new Converter<Post,
    	IPublishable>(delegate(Post p) { return p as IPublishable; }));
    Changing that to the following will only show posts created within the last 7 days

    PostList1.Posts = Post.Posts.FindAll(delegate(Post p)
    	return DateTime.Now.Subtract(p.DateCreated).TotalDays <= 7;
    }).ConvertAll(new Converter<Post,
    	IPublishable>(delegate(Post p) { return p as IPublishable; }));

    Nov 14, 2010 at 9:04 PM

    Once again, you are my hero! Thank you very, very much! Just what I needed to know!