Try our conversational search powered by Generative AI!

Allan Thraen
Aug 19, 2011
  5372
(1 votes)

Summer of Code: CategoryProvider – Alternate navigation

Here’s a little Friday goodie, in the end of the summer (although the weather outside leads me to believe that summer is already over). It’s not uncommon to want to use an alternate navigation method to access your content – like for instance using the built-in categories and list pages on your web site based on a taxonomy, rather than the usual tree-structure. Or what about quickly inserting a page-listing on your front page that shows everything tagged with a certain tag? As with everything else with EPiServer CMS it’s easy to do – and there are a couple of different approaches to do it. Being geeky as usual I decided to try to accomplish a rather elegant approach to this – that’s easily installable and will work anywhere. I’ve made an automatically attaching page-provider that will turn your categories (and pages tagged with them) into an alternate navigation tree living parallel to your regular tree.

Inspired by a few of my own old posts (mostly http://labs.episerver.com/en/Blogs/Allan/Dates/2010/1/Attaching-a-Page-Provider-programmatically/), I put this together in a few hours today.

image

This plugin requires EPiServer CMS 6 R2 Enterprise. All you need to do is download the assembly and put it in your ‘bin’ folder (unblocked, of course). Then you’ll notice a new structure under your root page, identical to your categories. By default it uses a pagetype that does not have a rendering, but it’s easy to set it to use another page type in the plugin-settings of this plugin. Beneath each category you’ll see the pages/content-items that are tagged in that category. Notice that it is the actual pages you are seeing – and if you select them it’s the same page as exist somewhere else in your structure!

If you change the category assignment on any page, it’ll instantly update the tree. I find this to be particularly useful as a source of listings – like putting a listing on your front page that lists all “News” items – wherever they reside on your site.

Download the binary here and the full source here. If you find this useful, drop a comment and I’ll be happy to put it on NuGet and Codeplex.

Aug 19, 2011

Comments

Aug 20, 2011 01:07 AM

Good stuff Allan! Wizbang aka Jacob also created a cool Dyanamic Content module for doing listings on pages based on Categories. We'll get that out to the world at the soonest possibility. Thanks for sharing this stuff!

Aug 20, 2011 04:30 PM

Wow, this looks really neat. Great work Allan!

Fredrik Josefsson
Fredrik Josefsson Aug 22, 2011 11:34 AM

Nice, nice... I like it! :)

Please login to comment.
Latest blogs
Optimizely and the never-ending story of the missing globe!

I've worked with Optimizely CMS for 14 years, and there are two things I'm obsessed with: Link validation and the globe that keeps disappearing on...

Tomas Hensrud Gulla | Apr 18, 2024 | Syndicated blog

Visitor Groups Usage Report For Optimizely CMS 12

This add-on offers detailed information on how visitor groups are used and how effective they are within Optimizely CMS. Editors can monitor and...

Adnan Zameer | Apr 18, 2024 | Syndicated blog

Azure AI Language – Abstractive Summarisation in Optimizely CMS

In this article, I show how the abstraction summarisation feature provided by the Azure AI Language platform, can be used within Optimizely CMS to...

Anil Patel | Apr 18, 2024 | Syndicated blog

Fix your Search & Navigation (Find) indexing job, please

Once upon a time, a colleague asked me to look into a customer database with weird spikes in database log usage. (You might start to wonder why I a...

Quan Mai | Apr 17, 2024 | Syndicated blog

The A/A Test: What You Need to Know

Sure, we all know what an A/B test can do. But what is an A/A test? How is it different? With an A/B test, we know that we can take a webpage (our...

Lindsey Rogers | Apr 15, 2024

.Net Core Timezone ID's Windows vs Linux

Hey all, First post here and I would like to talk about Timezone ID's and How Windows and Linux systems use different IDs. We currently run a .NET...

sheider | Apr 15, 2024