Author's RSS

Nov 25, 2008 at 2:12 PM
Is there any way to have an RSS feed for just a single author?
Nov 25, 2008 at 5:05 PM
It's not part of the code base to change an authors RSS feed. Generally you'll want to sign up for something like feedburner and use that link where ever you'd normally put the Author's RSS info. But if have some templates and multiple authors, then this gets a little more complicated. It's actually exactly what I did on my blog though, so here's how I did it.  Note: I'm using a DB backend and modified this to work for DB STORAGE ONLY. I'm sure the XML version is similar, but I have no use for it currently.

First open DBBlogProvider.cs. This is where the settings are stored and retrieved.
Go to the SelectProfile function and at the bottom, just before the return statement add the following code:

                       if (dic.ContainsKey("FeedURL"))
                          profile.FeedURL = dic["FeedURL"];

In the Same file, goto the UpdateProfile function and again near the bottom but before the // Save Profile Dictionary comment, add:

                        if (!String.IsNullOrEmpty(profile.FeedURL))
                            dic.Add("FeedURL", profile.FeedURL);

Now BE will load and save the value, but we need to give the profile class the FeedURL property so it doesn't crash. To do that open AuthorProfile.cs, and somewhere in the properties region (I chose the bottom) add the folowing code:

        private string _FeedURL;

        public string FeedURL {
            get { return string.IsNullOrEmpty(_FeedURL)?Utils.RelativeWebRoot + "syndication.axd?author=" + Id:_FeedURL; }
            set {
                if(value != _FeedURL) MarkChanged("FeedURL");
                _FeedURL = value;

Compile BE make sure nothings gone awry. The last thing is to update the Profile page to accept a value to be saved. In the admin/Pages/Profile.aspx, you need to add a label and text box for the FeedURL. This is my code:

      <label for="authorFeed">Feed URL</label>
      <asp:TextBox ID="tbFeed" runat="server"></asp:TextBox>
      <br /><br />

You'll note I didn't do internationalization by referencing the Resources. The reason is because only admins will see this and we're all english speakers. Maybe this could become a requested feature and added to BE with proper multi-language support, but you only need to put it in your language files if your authors want to choose different languages. So now open the Profiles.aspx.cs file, fine the SetProfile function and add

            tbFeed.Text = pc.FeedURL;

This will load the value to the textbox. To Save, goto the lbSaveProfile function and add:

        pc.FeedURL = tbFeed.Text;

Save both files and go view the result.

I hope this helps you out.
Nov 25, 2008 at 5:13 PM
Thank you for the great information--I might end up implamenting all of that. Doing the ?author= in the syndication link was actually all I needed to know though. :-)
Nov 26, 2008 at 2:32 PM
No Problem, but I'm sorry I misunderstood the question.