Blog » Using FeedFlare with Silverstripe

Using FeedFlare with Silverstripe

This blog now uses FeedFlare to add "sharing" links to the bottom of every blog entry (see the bottom of this blog entry). FeedFlare is a feature of FeedBurner, which is a tool/service designed to help increase traffic to blogs. The idea behind FeedFlare is to make it easy for people to share blog posts with friends. For example, a Digg user can "Digg this" post, simply by clicking on the "Digg this!" link. No need for them to manually copy the URL. People are more likely to do something if it is easy and takes little time.

The FeedBurner website gives instructions on how to add the FeedFlare code to several blogging CMS systems, but not for the SilverStripe blog module. A search on the internet brought no instructions on how to use FeedFlare with SilverStripe. Now that it has been successfully installed it into this blog, it makes sense to tell others how it is done, so that they do not have to figure it out on their own.

Installing FeedFlare into the SilverStripe Blog

The installation procedure is remarkably easy. There are two templates that must be modified, in order to successfully install the FeedFlare code: BlogSummary.ss and BlogEntry.ss. BlogSummary.ss is the template for listing blog entries on the main blog page. For FeedFlare to operate properly, it must be listed here. The BlogEntry.ss template handles the blog entry itself, and so must be modified in order to place the FeedFlare links at the bottom of each blog entry.

The basic FeedFlare code is:

<script src="http://feeds.feedburner.com/~s/myfeeduri?i=POST-URL-HERE" type="text/javascript" charset="utf-8"></script>

where myfeeduri is the FeedBurner URI for the blog, and POST-URL-HERE is the URL for the blog post (e.g., http://hdrlab.org.nz/using-feedflare-with-silverstripe/ for this blog entry). Myfeeduri is obtained from FeedBurner itself, and is detailed on their FeedFlare set-up page (e.g., "HDRLabBlog" for this blog). POST-URL-HERE, on the other hand, must be generated by the SilverStripe CMS.Thus, the template code will look something like:

<script src="http://feeds.feedburner.com/~s/myfeeduri?i=BLOG-BASE-URL{$Link}" type="text/javascript" charset="utf-8"></script>

where BLOG-BASE-URL must be replaced with the base URL for the blog (e.g., "http://hdrlab.org.nz/" for this blog). SilverStripe will replace "{$Link}" with the actual URI for the blog post. Thus, the code for this blog is:

<script src="http://feeds.feedburner.com/~s/HDRLabBlog?i=http://hdrlab.org.nz{$Link}" type="text/javascript" charset="utf-8"></script>

Once the correct format for the script code has been determined, it must be inserted into the appropriate templates. To place the FeedFlare links after the content, the script code should be inserted after "$ParagraphSummary" in BlogSummary.ss, and after "$Content" in BlogEntry.ss.Once this is done, and the new templates are uploaded, FeedFlare is installed.

Final Notes

FeedFlare will probably not appear immediately, so be prepared to give it a day or two before the links show up. To check if the code is correctly installed, simply visit the blog, and then look at the page source, if thescript code is present, then it is installed correctly. Also, make sure that the code is installed into the blog templates that the site is actually using. If a website uses a theme that has its own blog templates (look under themes/ in the website directories) then that template, not the base blog templates, will have to be edited. 

 



Blog » Using FeedFlare with Silverstripe

Post your comment

Comments

  • Thnks

    Posted by Mark, 21/10/2011 2:17am (13 years ago)

RSS feed for comments on this page | RSS feed for all comments


Blog » Using FeedFlare with Silverstripe