If you’re reading this on the website rather than through a feedreader and you look to the left you’ll see either a bunch of links to cited books or an Amazon ‘self optimizing links’ banner (though, if it keeps ‘optimizing’ like it has being I’ll be changing it to something else). This is implemented using a mildly hacked version of the standard typo
“But,” I hear you say, “The sidebar’s over on the right, and Typo can only support one sidebar.”
And you’re right, Typo’s admin interface can only handle configuring one sidebar, and I’m not entirely sure how to make it work with too – hopefully our new maintainer and usability advocate, Frédéric de Villamil has some ideas along those lines. So, how does it work.
Let’s take a look at a fragment of my
layouts/default.rhtml file shall we?
The thing about Sidebar objects is that there’s no real need to store them in the database. It’s done as a convenience so you can manage them through the admin interface, but if you want to use a sidebar widget anywhere in your layout there’s nothing stopping you.
Actually, that’s not quite true, before revision #1407, the
render_sidebars helper couldn’t take an argument, so you had to jump through a bunch more hoops, but (as you’ll see if you follow the link), the code change is trivial, if you need the functionality but don’t want to move to an SVN version of typo you can just change that one helper. The change should work in any Typo newer than about 8 months old, and the underlying idea should work with much older version too, you’ll just have to think a bit harder to apply the patch.