EXT:solr – Use categories as hierarchical facets

Since TYPO3 6.x the TYPO3 Core ships categories per default and I contributed support for categories as hierarchical facets to the EXT:solr.
This a quick tutorial on how to use that with an concrete example.

Make sure you are working on current master (3.0.0-dev) of EXT:solr or have at least applied the needed patch (see git.typo3.org).

Last a week Renan Gautier from France reached out to me with a question about that:

I’m using your CategoryUidToHierarchy function to display hierarchy of categories and it works great, thanks a lot for that work.
I want to show the category title instead of the category uid and I haven’t found solution to do so.

So what are the step’s needed:

  1. Configure you index queue to index the categories
  2. Configure the facet rendering to resolve the data from uid

As a result you will get a HMENU rendered as nested unordered list. With the power of stdWrap you are able to extend this basic example.


  • Edited 2014-04-18 3:15pm: I added line 23 in the second listing; thanks to Georg Ringer for pointing it out
  • Edited 2014-04-18 4:05pm: Added the name of the person who is the reason for this, after he granted me to do so.

Posted by:

Steffen Ritter
Steffen Ritter is a freelancer for TYPO3 CMS and TYPO3 Flow. He spends his spare time with improving TYPO3 products, singing in a gospel choir and watching US american tv shows. Steffen Ritter lives in the nahe valley - a small, but high quality, wine growing region in the south west of Germany.

Flickr impressions

    Imprint

    Steffen Ritter
    Waldalgesheimer Str. 33
    55545 Bad Kreuznach

    Creative Commons License
    This blog by Steffen Ritter is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

    For detailed information see detailed imprint

    Back to Top