Showing posts with label sitecore blogs. Show all posts
Showing posts with label sitecore blogs. Show all posts

Friday, December 15, 2006

Extending the RSS Module

the RSS module i really like. it's a good example of a great module that does what it's supposed to be doing. Alexey Rusakov is a wizard, can't put it any other way. his last posts about deletion workflow are really interesting and if you've ever thought about custom workflows i encourage you to read (apart from all the stuff at SDN5) Alexey's Deletion Workflow Part 1 & 2, and also Alex Shyba's Workflow with unpublishing article. now, with that said, i just thought i'd share a little example of how you can easily make your pages 'advertise' that there's feed content available on the page. modern browsers 'light up' to indicate a feed is present, and it's really, really, really simple - it's just a link in the header to the atual rss istelf. you don't need to have the RSS module, you can of course create your own, but i strongly recommend that you use the module. so, assuming you have the module installed & running you'd have a node somewhere that stores your feeds, here's what you do: 1) add a new Tree list field (i -so- love this field, i use it all the time) called "RSS_Feeds" to your content templates (even better if you got a sitewide template your content templates inherit from) and set the source of that field to your Feeds node (like '/sitecore/content/global/rss feeds' or something). 2) create a new class called RssAlternativeRenderer - this class will output the alternative links to the header of your page 3) add the following code to your new class
public static void GetRssUrls() { Item root = Sitecore.Context.Item; System.Text.StringBuilder sb = new System.Text.StringBuilder(); if (root != null) { if (root.Fields["Rss_Feeds"]!=null) { Sitecore.Data.Fields.MultilistField mf = root.Fields["Rss_Feeds"]; if (mf != null) { if (mf.Count > 0) { foreach (Item itm in mf.GetItems()) { sb.AppendLine("<link rel=\"alternate\" type=\"application/rss+xml\" title=\"" + itm.Fields["Title"].Value.ToString() + "\" href=\"" + itm.Paths.GetFriendlyUrl() + "\" />"); } } } Sitecore.Context.Page.Page.Header.Controls.Add(new LiteralControl(sb.ToString())); } } }
4) add the following code to your Page_Load event

protected void Page_Load(object sender, EventArgs e) { RssAlternativeRenderer.GetRssUrls(); }

that's it. now compatible browsers will 'light up' all shiny and stuff when you select a feed that will be available on a page - ain't that great for christmas? finally, wrapping up, Alex de Groot just posted his 1-year-blogging-anniversary post. Congratulations! today is friday - today is afterwork - today is gonna be one more day that i forget to go buy gifts.. but hey, at least it's friday.. take care, P.

Friday, August 25, 2006

Items and their security

Security is a tricky thing, no matter what application or layer you're trying to manipulate/access. First up, sitecore has awesome security, and with each release it keeps getting better and better, so that's a really big + for them, and that's why i'm just gonna relay this post to Alexey Rusakov instead since he's worked on this a lot (i only wrote a work-around). So, go read: Alexey Rusakov - More on 'Hidden' Items that's it for me today, it's friday and almost time for after-work beer :) have a great weekend, P.

Tuesday, August 22, 2006

Tthe importance of looking ahead

First release has seen daylight and now (i think) i can finally breathe again.

It's been interesting, that i can't argue, but it's also proven to be quite challenging at times. Had to figure out a lot of new ways to do things you know you somehow should be able to do. Next in line will probably be updates and enhancements and what-not but that's all in the coming so i reckon for this very moment i'm quite happy with the release i've made and the chance to breathe again.

Ever thought about the way blogs and articles help you think outside the box? Well, i have.

There are people that do a lot more for others that they think. People that don't just develop solutions, they also develop other people. They are, in lack of better words, people developers.

Think about it: Who hasn't glanced at pieces of code in articles from the various sitecore blogs? or adapted the code from sdn5 to suit their needs? I know i have.

All these authors, thinkers and futurists make a difference if you ask me - They're part of a new breed of developers, of teachers.

You know what? let's dub them knights of sitecore. Along with the awesome code in sitecore their ways of adaptation and use of it make damn sure that people, like me & you, keep looking ahead, looking for more & striving to improve.

Sitecore, and their knights, are one step ahead, and from what i'm seeing people are running as fast as they can to catch up.

This time my hat's off to you all, and hopefully you know who you are.

That my friends, is the importance of looking ahead.

P.