We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 40088
    • 708 Posts
    @Everett, that looks very cool. Thanks. It should make building a categories-based blog even easier.

    Just so I understand, Taxonomies would replace add-ons like Tagger and TagLister, yes?
      Todd
      • 36516
      • 179 Posts
      Yes, this looks like a fabulous start to what we've desperately needed for years now.

      I say "start" only because while it looks solid, and a good approach to the problem, the video I just watched left me wondering if there was a way to search/filter the backend.

      I presume you could continue using the likes of GCK or Collections to present articles/posts in the manager, but do we still need a way to search/filter categories/tags? If so, it seems to me that's he next logical step to making this a truly useful addon, if it isn't already.

      Great work, Everett. This is quite important to me, and really ought to be more important to the modx developers. If I had the time I'd love to have jumped in and had a go at something like this myself, but as you appear to have already made a good start on a great solution I'll swallow my envy and get on and support you with testing at the earliest convenience.

      It might be nice to know more about you, actually. I find myself curious as your credentials, and subsequently how much faith we should have in you and your work wink In the nicest possible way...

      I wonder if there are any other dramatically different approaches to this problem that might crop up. I support open source and lots of people getting stuck in, but I also prefer to know when there's a "clear winner" when it comes to choosing a solution to a fundamental problem. I'd rather not discover another four addons that claim to do the same thing and then have to mess about trying to establish which is "the one", as I'm likely to have to do when I eventually have a shot at ecommerce in modx :/
      • @todd.b : yes, this represents an alternative (i.e. replacement) for Tagger, TagLister, et al.

        @Dave Smith: Yes, you can search/filter the backend -- that's part of what the video demonstrated, so it sounds like you missed it or you're asking for something else. See the wiki for more examples. You can view my github profile or Linked in profile yada yada I'll let you do the googling re credentials. If you're able to look at the code and the architecture you can evaluate the solution yourself. This is more or less the same pattern available in Drupal and WordPress, but this one actually supports a true hierarchy, which WordPress (at least as of version ~3.7), did not.
          • 40088
          • 708 Posts
          Thank you, @Everett. Very promising.
            Todd
            • 36516
            • 179 Posts
            This is the video I watched: https://www.youtube.com/watch?v=CFidcBQDJ0Q&feature=youtu.be

            I watched it again and saw nothing about searching/filtering to find posts that belong to a given category. I imagine that'd be best accomplished with a grid view of posts and filter/search controls, just as in WordPress. Perhaps I've missed something, but I'm definitely not seeing what I mean in that particular video. Is there another video?
              • 36516
              • 179 Posts
              Another curiosity that crosses my inexperience mind (I'm a long-term modx dabbler, but ultimately inexperienced and just getting started with more advanced functionality and extensions) is the difference between your approach of using tree resources as taxonomy containers, and the alternative approach taken by Gallery, with a separate and custom manager page and UI.

              I'm split between the concept of having the category hierarchy represented in my resource tree, and having them segregated elsewhere so as not to clutter the tree of actual site content. I wonder if there's an accepted best practise, or if you have a personal stance on the issue.
                • 36516
                • 179 Posts
                Your Asset Manager looks amazing, also. Great work. I have a project upcoming that suits both these addons and I look forward to trying them out.
                • @Dave Smith: a good portion of the video dealt with the getPagesByTerm Snippet (https://github.com/craftsmancoding/taxonomies/wiki/getPagesByTerm) which does exactly what you want: it shows posts belonging to a certain category (i.e. pages associated with a TERM). Because category terms are represented by pages, the snippet can use the current page id as the default input for its &term_id argument. In other words, when you visit the "Mammals" page (as I did in the video), you are effectively saying "Search for all pages classified as Mammals and list the results here." Searching and finding. Better watch the video again, or better yet, try installing it and using the Snippets. They are all documented. If you decided to write your own search snippet to show pages belonging to a certain term/category, you'd end up with something like the getPostsByTerm Snippet, I guarantee it.

                  I'm intimately familiar with how WordPress does this, and this does everything that WP supports and more. You mention a grid of posts and "search controls" -- take a look at the getTagCloud Snippet. The backend tables I have in the Taxonomies extra follows the same pattern as WP, and my choice for using MODX resources (i.e. pages) to act as taxonomical terms (i.e. Categories and Tags) came from WP since the users ultimately go to a page to view other pages/posts in a certain category. However, WP becomes cumbersome with its URL mapping and its template system is onerous whereas MODX handles this elegantly: you have a MODX page which can have any template and any URL. So in WP, a taxonomy is arbitrarily registered in an obscure functions.php file or in a plugin, or really anywhere (good luck finding it), and you can arbitrarily add or remove terms from it if your post-type is associated with that particular taxonomy. It's a pain to debug. Instead, I have implemented folders as taxonomies (i.e. containers), and terms as pages (living inside a taxonomy): that keeps everything very flexible and very visible. There's no guessing what's been defined and you can easily hide/unpublish terms or rearrange their order etc.

                  I don't think Gallery is really a Taxonomical solution, but you do bring up the debate on whether the back-end taxonomies should be stored as independent objects in their own table. I don't think there's a best practice for something like this. I chose to represent taxonomical terms as MODX resources for several reasons: part of this is because there's already a GUI in place to modify and re-arrange pages, but also (as I mentioned) because users ultimately go to a page to view a particular taxonomy's contents (a la WP's categories.php template file). The other reason I used MODX pages was because after supporting so many WP sites, I know that eventually some clever person will want to attach "meta data" to the taxonomy or to the term... and then you begin the slippery slide into the blurry backend data model and the unending hell of supporting a dynamic data model with constantly changing custom fields. By representing terms as MODX pages I sidestepped that whole quagmire and you can add TVs or change templates or change URLs if you desire. If you wish to keep your taxonomies from cluttering up the resource tree, I would recommend just putting them in a sub-folder somewhere out of site.

                  Hope that clarifies. If you can clarify what exactly you're looking for that you're not finding, I could possibly point you to a more precise solution. HTH
                    • 36516
                    • 179 Posts
                    I may be confused, or perhaps you can explain to me how all this applies to the manager (backend), as opposed to the frontend. I get how you display all the content from the categories - all that goes without saying. But when you suggest the use of snippets to get the pages from a given category are you implying that the same snippet(s) can be used to construct backend/manager pages?

                    What I'm getting at is that you have manager UI to tick boxes and apply categories to pages on a per-page basis, but can you also then - in the manager - see a list of all the resources in a given category? That wasn't covered in the video, but if there's a way to use the snippets I imagined were for frontend use also in the backend/manager, then super, I suppose, though I'd have thought this could be provided as established manager UI in a future update.

                    It seems more likely I haven't made myself clear, though I can't discount the possibility that I'm all in a muddle and jetting off at a tangent.

                    When I say "searching/filtering in the backend" I'm not talking about how to enter snippet calls in resource content with a view to displaying the content on the frontend. I'm talking about literally displaying, in tree of grid view, list(s) of the resources you've allocated to specific categories, for management purposes only. So you can find specific resources which will otherwise be 'lost' in a potentially lengthy and unordered tree branch of "posts".
                    • Ahhh... that makes sense. There is currently no functionality in the manager to filter content by taxonomy term. Since MODX uses the resource tree, that's not something that's easily done because it's not supported by view. It would make for a good feature request (I've added it): https://github.com/craftsmancoding/taxonomies/issues/4 but it couldn't be a universal solution without a table or grid layout like you say, but it would be hacky without a grid view.

                      Here's a new page in the wiki putting this side-by-side with WordPress: https://github.com/craftsmancoding/taxonomies/wiki/WordPress