Using a DataView to show a Blog in its parent site

I thought I should point out that I am using a Data View Web Part on my site’s home page to display the most recent three posts from my blog. Although I decided to create my blog site as a subsite, using the Team Site template as my top level site, I wanted to have the most recent content from my blog showing on my home page. Why? Because Aaron Ericson advised me that certain search engines pay more attention to you if your site’s home page changes more often.

So after I had created my blog site, I went back to my top level site and added a web part to my home page…except that there was no RSS Reader to be found, and of course the Lists listed only are for the current site, not any children sites. Ok, I can work around that. Anything that spews forth an RSS feed or is a SharePoint list can be displayed by the Data View Web Part, which you can find in SharePoint Designer 2007. I knew this because I had watched the webcast of Dustin Miller’s Tech Ed 2007 presentation. Prior to that, I knew that Data View Web Parts were powerful tools in Front Page 2003 for SharePoint Portal Server 2003, but had never used them. So when I saw Dustin’s post, I was intrigued – after all, my current professional goal is to Know Everything About SharePoint – and I watched the webcast. He shows, among other things, how to use the Data View Web Part to display Yahoo! Weather on your SharePoint site, where you can pick a zip code at run time. Highly recommended.

As to how I set up the Data View web part in SharePoint Designer 2007, the trick to accessing the Posts list in the subsite while you are working on a page in the parent site is to add the subsite as “another library” in the Data Source Library pane.

SharePoint Designer is a great tool for one-off site tweaks, and I’ve used it a lot to customize BlumenthalIT.net . But in a scenario where you want to make changes that you can deploy from a staging environment to a production environment, or one where you are doing that and want to create all your customizations as Features that you can deploy to multiple sites, it falls short (probably by design). So for example, if you are building _layout\ pages (application pages) or reusable workflows, you’ll probably want to do that in Visual Studio. Note that Ted Pattison and Andrew Connell have some great articles (here and here) on building application pages and site pages and when to do which one. I’ve started building an application page, and there are some interesting quirks to doing so, but that’s a post for another day.

–Michael

 

Leave a Reply

Your email address will not be published. Required fields are marked *

*