WebParts based Sidebar for EPiServer – the motivation and specification
January 8th, 2009 by Adam Najmanowicz | Leave a CommentBack in the day when we started designing our last project weâve been presented with a following problem â a big number of templates with slightly different sidebars.
HmmâŚ
Is sidebar a part of content? No, rather not. We donât want the editors to have to setup the sidebar for every article they write (and the site has a few dozens of articles created on it every day).
Is sidebar more of a template thing? Well⌠more like it, but still⌠we have articles all over the site with different sidebar elements when the articles are in different parts of the site (ok so we could add rules what controls display in which part of the site). But wait! Thereâs more! The sidebar will be different for every language (region). Now weâre talking a dozen of templates or a rules engine just to make the sidebar different. Customising the template with properties isnât ideal either as it makes EPiServer UI very cluttered. Additionally we want to change sidebars across many templates so the whole branch/section of the site will be able to share the same sidebar.
To a degree this is an academic discussion as weâve been through it with the previous version of the site and we already knew that integrating this stuff into templates just wonât work and we will be in a world of pain just changing the templates over and over adding little tweaks and changes while the customer ads promotions and performs ad campaigns. Well, we can do it, of course, but itâs not a work a programmer will enjoy, and we all want to do new and more exciting things, donât we?
We have an internally developed module to make something like that, that is fully home-grown by another internal team (we now have 3 âsquadsâ capable or making incredible things with EPiServer and we tend to share a lot of technologies and try to rotate people around to adopt the good habits and experiences) and I was (and still am) VERY impressed by it. The technology uses EPiServer pages for defining every module (which are located somewhere outside the site root branch. and then you can mix and match them either declaratively in the code) or by handpicking them in the UI. Itâs really cool, though, during the discussions it turned out that we might have to add big chunks of functionality and might end up with separate branches of module-pages for different languages/regions, but⌠frankly⌠about that time an article by Ted Nyberg reminded me about a technology I have read about quite a while ago in an article by Stein-Viggo Grenersen and ooohhhhhh⌠I got seduced. I really wanted to try if for a long time and Tedâs article made it a snap to try and get convinced, and more important⌠convince Stu ;) that itâs the right way to explore.