Thursday, March 25, 2010

Online Woodworking Community & Widgets in Static Pages

If you're reading this then chances are you're familiar with the Online Woodworking Community. That unofficial group of half mad woodworkers who can't find enough people close to them to talk about woodworking they need to plaster it all over the net. (And have a good deal of fun in the process!)

I've added a section to ~theloveofwood~ to function as a blog roll; a list of blogs that I follow regularly. Never to do anything simply; a list wouldn't do, I wanted active RSS feeds. After some tweaking; it's alive.



Blogger Tweak
As a general rule, Blogger, does not let you add widgets to the (static) pages or the main post section. This cause me some problems when I wanted to make my blogroll actively incorporate the RSS feeds of those blogs. I got around the problem after reading a few forums and some coding.

The first step, in the template HTML section I needed to change showaddelements to yes. This may be different in your template.

b:section class='main' id='main' showaddelement='yes'


This enabled me to add widgets to the center section as I would anywhere else on blogger.


After clicking 'Expand Wiget Template' you can edit the properties of the template. Blogger allows the use of 'if cond' condition statements which allows the code to ask a question. In this case is asks a simple question 'is this a post page or a static page?'

If the question is true, than any code between the if and the /if is run.

b:if cond='data:blog.pageType == "static_page"'


In this example: is the page static? (ie. my only static page is my blog roll) If it is show the widget (ie. the RSS feeds for the blog role.) If it isn't don't show the widget (ie. if it's post and not the blog roll page, don't include the widget.)


No comments:

Post a Comment

Like at Facebook

Redbubble