View Recent Posts on a web page that's in a parent folder to my BlogEngine folder

Topics: ASP.NET 2.0, Themes
May 30, 2008 at 3:20 AM
Greetings all!

I was trying to figure out how to write the code to View Recent Posts, but not in one of the BlogEngine pages. Rather, on a web page that is in a parent folder to BlogEngine.

So, this site kind of has two parts to it:

1. The front side that is completely separate from the blog
2. The blog side (which is under the resource library tab)

I basically want to figure out how to get a few of the most recent posts on the front page of the site (so newcomers can easily see what's happening)... here's a link to the site so far <>

Thank You,
Grace Media Productions
May 30, 2008 at 9:25 AM
That's kind of what I'm doing myself (don't have the site on a public server yet). I'm using the patch I uploaded for codeset 10974, see Installing BlogEngine 1.3 in a /blog subdirectory. How?

This would be a case when you want to integrate blogengine functionality outside of its folder (while still keeping some separation in your source files). You'd reconfigure your /BlogEngine virtual app to be a subfolder of the root web site (ie, don't make it an application), and change BlogEngine.VirtualPath to be ~/BlogEngine/ (and merge the Web.Config settings and other changes documented in the thread and the patch readme).

Then you should be able to add <%@ Import Namespace="BlogEngine.Core" %> to your page and put <blog:RecentPosts runat="Server" /> in a div where you want it to display (see SidePanel.ascx in the sandard theme folder, note class="box recent" in the surrounding div and add something equivalent to your stylesheet - or include BE's if it doesn't cause issues with your own stylesheets).

I'm working on updated patches (have for a few weeks, been busy on other project) for newer codesets. You can either use the existing patch and/or wait for the others (check the notifications checkbox in the other thread).
May 30, 2008 at 10:07 AM
Edited May 30, 2008 at 10:14 AM
I had the exact same scenario and found that RssToolKit was the ticket for me. I am using it 3 times on my main page at Display any RSS feed anywhere. Here's a link