| Paul's profileAutoSpongePhotosBlogLists | Help |
|
|
November 16 News Site Content Summarized AnywhereThis week's challenge: make the conent from the News site bubble up to the front page of the site collection.
Sounds easy, right? Well, the dynamics of the List and Library structure prevents you from selecting another site's data as a web part. So, you have to get creative (especially when you dislike raw code as much as I do).
The first option was to use the RSS feed from the News site library. But, the RSS web part doesn't allow authenticated feeds (my site isn't anonymous). I figured out a way around that by setting up the RSS feed as a Data Source in SPD, but the data was far from being presentable.
The second option was the search results web part. This seemed closer but between the XSL translations and a lack of certain data being indexed by Search (like the rollup image) I never felt good about the results.
But today was a big win. So far, I'm very happy with the solution and it's a model I can replicate elsewhere in the site. I created a "blank" page with a DataForm web part and used an iframe on my homepage to see the results of the DataForm's query.
Here's where you need to configure your design's look and feel. For me, I wanted 6 items to appear (2 columns of 3). I selected "Change Layout" from the common tasks menu and found the closest match. I moved some elements around in the template until I was happy with it. Then, I limited my paging to 6 results. I set the filter to "Content Type Equals 'Article Page' or Content Type Equals 'Redirect Page'". Since my blank page, the archive page, and default page don't have those content types, they won't appear in my new page (or the iframe). I added an iframe to the homepage with a content editor web part.
Because I was using an iframe, I needed to make sure that none of my links would trigger navigation inside the frame. I went back to SPD and wrapped my titles like this:
I noticed that my rollup images were using the URL provided in the rollup image form, so I changed my forms to leave the URL area of the rollup image dialog blank and wrapped the rollup images as well (if you don't blank out the URL, the wrapped href won't work):
I cleaned up my webparts (minimized chroming on the new page and set a nice title on the homepage) and published. It looks just like a 2-column Summarized Link web part but it's all dynamic. I can forsee using a lot more Redirect Pages in the News site for quick updates. The only thing that doesn't work *exactly* as I'd like is the iframe height. For some reason, the web part doesn't want to resize appropriately so I had to set the height to 200. I suppose if I get enough long-winded descriptions in the result set, I may have to poke back into the content editor web part and increase that. If anyone knows exactly what that's happening, drop me a comment or IM. Trackbacks (1)The trackback URL for this entry is: http://autosponge.spaces.live.com/blog/cns!D7F85948C20F0293!235.trak Weblogs that reference this entry
|
|
|