We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 40131
    • 40 Posts
    I am struggling with the following problem.( Modx Revo) How to create an "Archivist" style menu for explicit docs(template) in a big tree under one parent. (but without child links of each doc)

    The scenario is the following:
    - I have a doc parent 4 levels deep. Under the last folder level I have a page with its own template e.g. "event".
    - this page has custom TV - date, e.g. the event start on month X, year Y. This is not related to published date. The doc is already published. This like a calendar of events in the future.

    I want to construct a menu that filters the complete tree, extracts the month and year of only published docs with template id (only) and returns the followng:

    <ul>
    
    <li><a href="calendar.html?date=201209">Sept 2012</a></li>
    <li><a href="calendar.html?date=201210">Oct 2012</a></li>
    ...
    <li><a href="calendar.html?date=YYYYXX">Month Year</a></li>
    
    </ul>


    Every click of a link should return a list with getresources the relevant pages that begin in month XX on year YYYY.

    When a event goes unpublished and there are no other events in month X, year y, the menu <li> item should disappear as well


    Any ideas?
      • 3749
      • 24,544 Posts
      I don't see any way of doing that without a custom snippet (though that doesn't mean there isn't one).

      Wayfinder would get you close to your menu, but I don't think it will filter the results the way you want (by template).

      I think getResources TVFilters could get you the results, but if you want clicking on the links to show the information on the current page rather then forwarding the user to another page, you'll have to use JavaScript as well.



      ------------------------------------------------------------------------------------------
      PLEASE, PLEASE specify the version of MODX you are using.
      MODX info for everyone: http://bobsguides.com/modx.html
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
        • 40131
        • 40 Posts
        Generally the major problem for me is the dynamic menu generation and grouping TV data in only one link.

        E.g. we might have dates in doc's TV

        07-03-2012 h:m:s
        07-12-2012 h:m:s
        ...
        07-29-2012

        that snippet should filter only the month and year - i.e. july 2012 and not the day and h:m:s. Then the result is ?date=201207

        I don't see a way to filter partial TV data and avoiding generation of repeating elements when using wayfinder, getresouces, tagLister or whatever.


        Anyway - already I have the other solution - the results using getpage + getresources which is non-javascript, just a list with paging.