Don't miss out Virtual Happy Hour today (April 26).

Try our conversational search powered by Generative AI!

Allan Thraen
Aug 19, 2011
  5380
(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
Azure AI Language – Extractive Summarisation in Optimizely CMS

In this article, I demonstrate how extractive summarisation, provided by the Azure AI Language platform, can be leveraged to produce a set of summa...

Anil Patel | Apr 26, 2024 | Syndicated blog

Optimizely Unit Testing Using CmsContentScaffolding Package

Introduction Unit tests shouldn't be created just for business logic, but also for the content and rules defined for content creation (available...

MilosR | Apr 26, 2024

Solving the mystery of high memory usage

Sometimes, my work is easy, the problem could be resolved with one look (when I’m lucky enough to look at where it needs to be looked, just like th...

Quan Mai | Apr 22, 2024 | Syndicated blog

Search & Navigation reporting improvements

From version 16.1.0 there are some updates on the statistics pages: Add pagination to search phrase list Allows choosing a custom date range to get...

Phong | Apr 22, 2024