This project is read-only.

i seem to have broken the # of char's to show for blog descriptions

Topics: ASP.NET 2.0, Business Logic Layer
Jan 14, 2011 at 7:59 AM

In the settings i have 'only show description of post' checked and i've tried setting the number of characters to anywhere between 10 and 400 - it just seems to show the whole post instead. Could you tell me what section of code i should look at to try and fix that?


Jan 14, 2011 at 8:25 AM

In PostView.ascx, are you outputting the content of the post via <%= Post.Content %> .... or are you using a PlaceHolder with an ID of "BodyContent"?

Both work, but I think rules such as only showing XX number of characters is applied when using the placeholder.  Here's what the placeholder should look like:

<asp:PlaceHolder ID="BodyContent" runat="server" />

BE will output the content of the post in that placeholder.  Or if it should just be XX number of characters, then it will output that excerpt instead.

Jan 14, 2011 at 8:28 AM

Related to this, in case you weren't aware of the BreakPost extension, that allows you to insert [more] into your post where you want the front page description to break at.  If you use this, you would want to disable, or not use the "only show description of post" option.  You don't want to use them together ... just use one or the other.  The advantage of [more] is that you can control exactly where you want the excerpt to break at for each individual post.

One is not necessarily better than the other.  Just depends on your needs.

Jan 14, 2011 at 6:00 PM

It was using post.content - i'll try the placeholder and see if that resolves it, although it sounds like using the breakpost extension would be even better for my needs, so i'll look into that.


Jan 16, 2011 at 7:39 AM

fyi - using the placeholder resolved the issue. I'm not sure how i got rid of it in the first place. thanks for the help