We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
  • Hi all,

    I was wondering if anybody had considered introducing taxonomy support for MODx?

    The reason being that it’s something that I’ve had to implement for a local government website in the UK. I actually find it quite powerful in terms of filtering content based on selected terms etc.

    If there was a need for it, I’d be willing to give it a stab, I’m just thinking it would be a sizable development so any thoughts would be welcome.

    My initial thoughts are:


    • Create a taxonomy manager module to allow the creation of a taxonomy
    • Create a module to list content items and provide the ability to classify them against a taxonomy term
    • Add a taxonomy metatag (is this possible?) so the term can be included in the page metadata
    • Add a snippet to display content items filtered out against taxonomy terms


    Initially, I’d be looking at restricting taxonomy creation to only via the manager module but don’t see any reason why it couldn’t be expanded to have the ability to import taxonomies via XML.

    So, does anybody have any thoughts on this?

    Cheers, Garry
      Garry Nutting
      Senior Developer
      MODX, LLC

      Email: [email protected]
      Twitter: @garryn
      Web: modx.com
    • In this case, if I understand completely, you mean taxonomy in the sense of a hierarchical map of categories used to ’tag’ various content items. To this end, I can think of two approaches that could be taken here...

      1. Use the existing modx_categories table, add a parent column to represent the hierarchical structure, and you’ll be able to use this as a taxonomy. Then create a cross-reference table that includes a foreign key to a categories record, the type (e.g. table name) of the related entity, and the primary key (i.e. ID column) of the related entity. Then you can relate your tags to anything from a document to a chunk, TV, or snippet.

      2. Alternatively, I plan to add a sort of generic metadata system in Tattoo; these will allow you to attach a taxonomy of related information, no matter what it is. Consider attaching your taxonomy terms, an XML definition of related workflow rules, some AJAX information(?), some Dublin Core standardized document metadata, and/or some user-defined objects to each document in your site. This will of course, be a lot more complex to implement, but I believe will be an indispensible tool in implementing complex applications with little or no programming. It’s only in the idea stages wink, but in this case, importing/exporting your taxonomies would be part of the core installation and data migration facilities. However, might be a little heavy for the simple requirement of tagging documents with taxonomy terms.

      Just some ideas until something more formal is available in the product.
      • Thanks for the ideas, definitely food for thought.

        You’re quite right in my idea of a taxonomy, I get so used to using jargon on a daily basis I forget not everybody might understand what I mean. embarrassed

        Your first idea appears pretty good from the angle I was coming from, I’ll have to investigate a bit further into it.

        As for the second idea, that sounds brilliant! Be great if that gets implemented. Wow, I can only imagine the possibilities with that type of functionality available.

        Cheers, Garry
          Garry Nutting
          Senior Developer
          MODX, LLC

          Email: [email protected]
          Twitter: @garryn
          Web: modx.com