Share via


Check out my blog's Webslice (alt: how to add a Webslice to your blog)

So having just installed IE8 beta 2 today I thought I'd have a go at creating a Webslice for my blog...Turns out it's pretty easy, and I was even able to put a version of the Popfly mashup from my last post in my preview (added my blog's logo to make the slice a bit more visually appealing - clearly I missed my vocation as a designer). Since it uses a mashup, it has active content (e.g. javascript) so as a result I needed to use an Alternative Display Source.

 

For background, my first attempt below only showed the text "The things I write here..." etc. but not the Popfly mashup:

 

<div class="hslice" id="ronang-news-webslice">
<p class="entry-title">Ronan Geraghty's Blog</p>
<div class="entry-content">
<iframe style='width:100%; height:280px' src='
https://www.popfly.com/users/ronang/NewsWebSlice.small'

frameborder='no' allowtransparency='true'></iframe>
<p>The things I write here represent my own opinions. I always value your feedback in the post comments, or to my

Inbox via the <a href=" https://blogs.msdn.com/ronang/contact.aspx" >Contact</a> link.
</p>
</div>
</div>

 

But, using an Alternative Display Source is pretty easy - this is all I needed to add to my site:

<div class="hslice" id="NewsWebSlice">
<p class="entry-title">RonanG's News</p>
<a class="entry-content" rel="entry-content" href="
https://www.popfly.com/users/ronang/NewsWebSlice.small" />
</div>

(I know what you're thinking - why isn't the alternate display source another page on my site which has the Popfly mashup embedded, but I don't have that luxury since this is an MSDN-hosted blog  and I'm limited in what I can change - using another page on my blog pulls in the whole theme of my blog which is too large for the Webslice preview).

And here's what my webslice looks like:

image

Clicking any link opens a new tab in IE 8. There's more that could be done with controlling updates and notifications, but it's getting late, and I'm not that prolific a blogger so I'll just use the default update schedule of 24 hours for now and maybe do some more tweaking later...before I finish I just want to make one more point:

Obviously this is all backed by the RSS feed off my blog so you could justifiably say it's a bit of a contrived example - however, don't forget that the webslice is using a popfly mashup, which is active content - so clearly you can have some more compelling content within your slice.

Also I'm somewhat restricted in what content from my blog I can show in my webslice...if it's your own website and you have full control over a page's code (HTML, javascript plus ASP.NET/PHP/whatever) then you can take it to the next level - ebay's webslice being a case in point:

 

image

For example, if I had full control to write code, rather than using the RSS feed I might query my blog engine directly for recent posts which are tagged with "Developer", and show only those in my webslice - but hopefully you get the idea how easy it is to add a webslice to any site, even a blog :-)

Other examples that spring to mind would be airline seat sales, hotels with special offers, breaking news for a newspaper's online presence and so on.

For some more webslices, check out https://www.ieaddons.com/en/webslices/

Comments