Showing posts with label DNN Internal Syndication. Show all posts
Showing posts with label DNN Internal Syndication. Show all posts

Monday, March 30, 2009

DNN Internal Syndication - Branding Syndicated Content

by Phil 'iwonder' Guerra - (Avondale, MO) - As you’ve probably seen, the latest versions of browsers provide a quick interface to syndicate newsfeeds and present them with just a few clicks of a button. It’s a nice feature, and for those folks that don’t want to use a stand-alone news reader, it offers a quick link to keep up with their favorite web sites. The one problem with using a browser to present a news feed is most do not support use of your site’s Channel details to be rendered. That’s an unfortunate situation, as it takes away one of the primary reasons for creating syndicated content. No doubt many companies would like their company icon and a brief note about what they offer, displayed with their syndicated content. However, browser technology is deciding what to render, whether you like it or not, and your site's channel details are often left out. The end result is you may be missing out of a marketing opportunity to brand your syndicated content when it is used with browsers.

Using Microsoft’s Internet Explorer and Apple’s Safari, you get a feed rendered, and only the Channel Title is displayed. With the FireFox browser, you may get the site title and description. So, what can you do about the situation?

The simple solution with DNN is to always include an entry that contains that information. However, that approach may not be possible if the module you are syndicating doesn’t give you an opportunity to do it. This simple solution may be impractical depending on how many module instances you have that offer syndicated content because you have to add an entry item for each one. Implementation of internal syndication varies by DNN module, so there is no one set way to achieve the solution.

Another approach that I took involves adding a bit of code to the DNN core, RSSHandler.vb. You’ll find this code in the /Library/Services/Syndication folder, with DNNv5.0.0. The bit I’ve added calls a simple routine to always add an item to syndicated content, which includes the Portal title, description, and you could add graphics if you choose to do it. Now, when a users clicks the syndicate icon, and their browser renders it, they will get the Site branding displayed as a newsfeed item.

The code I’ve added may not be best practices, but it’s working for me, and the client is happy, and that’s the most important item of all. Here’s the code, and note after you’ve added it, you can just choose to build the library from VS2005 or VS2008 to implement it. I place the call to the routine right about the line that checks searchResults, this way I always add my site branding item, even if there are no other items available. In fact, RSS v2.0 specifications state that there should always be at least 1 item in a feed, so this makes DNN internal syndication more RSS v2.0 compliant.

Channel.Items.Add(AddSiteBranding())

If searchResults IsNot Nothing Then….

Next, the routine that adds the site branding item:


Private Function AddSiteBranding() As GenericRssElement

Dim item As GenericRssElement = New GenericRssElement()
item("title") = GetPortalSettings.PortalName
item("description") = GetPortalSettings.Description
item("link") = AddHTTP(GetDomainName(Request))
item("pubDate") = Now().ToUniversalTime.ToString("r")
item("guid") = AddHTTP(GetDomainName(Request))
Return item

End Function

Now, be sure that you add only item tags that match what the feed is already adding to maintain consistency in your newsfeed. The result gives you a syndicated feed that displays your Portal Name, along with the Description of your portal. Now, when folks syndicate it in a browser, you’ll have a bit of a marketing edge always available. I’ve thought of some other variations of this type of branding, including adding some database items and using a routine to fetch items randomly. Otherwise, what is being displayed actually comes from your Portal’s information. Hopefully, you are using the Host Administration page to add your portal description, which is the source for this information. You can even add an image to the Portals description textbox to add more branding to your feed.

Here’s what an example implementation looks like in IE8, the first item in the feed is the branding item.






Of course, you might want to make the other core code changes I’ve mentioned in previous installments on my blog to get other enhancements. I use a slightly modified version of the Announcements v4.0.1 and vw_Search SQL view in conjunction with this change.

Sunday, January 4, 2009

Updating the RSSHandler and vw_Search

by Phil 'iwonder' Guerra

--- (Mission, KS) - I've wanted a better DNN internally generated news feed for quite some time. I had so much work in my queue that updating the DNN core code was one project held back. For the most part, I left the project up to the Core Team, afterall it is core code.

Well, I'm not satisified with the progress, and the DNN CT certainly has their priorities, and I'm not going to criticize the lack of attention, but I'm moving forward with taking on the project. It's not a very easy set of tasks to undertake, though. There's a lot involved, due to the coupling of the RSS feed generation to the Search mechanism, but I was surprised at how relatively fast I could deploy an improved news feed with a few minor changes to the RSSHandler, and the vw_Search SQL view. The results yield a much more rich RSSv2.0 feed, giving your public feed branding and support for many of the standard RSSv2.0 tags, not all mind you, but enough to allow you to syndicate with the internal methods, rather than a custom approach.

There's a lot more to be done, as I've only been targeting one module to incorporate the changes, the Announcements module. The enhanced approach requires some tweaking of a module's support of RSS, which is seriously deficient in most modules. I don't understand why most module's even have the ability to syndicate without providing support for it. Oh, well, that's another story.

I'll post more about the effort and provide the code in another post. Right now, it's time to celebrate my son's 21st birthday.

Cheers