We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 44140
    • 25 Posts
    I'm eventually getting round to moving one of my band websites onto MODx and am looking forward to doing some interesting/usefull stuff.

    It occurs to me that the Articles add-on is exactly what I am looking for in gig listing pages. It does dates, searching, sorting. tagging, different views etc. The more I think about it the more I realise it's what I would like to use.

    The only issue is that "Articles" dated in the future are not published. ie. gig dates in the future.

    The perfect solution would be a tick box in the settings that says something like "Publish articles with dates in the future".
      • 44140
      • 25 Posts
      OK, replying to myself.

      I'm going about this in a slightly different way.

      I've created a TV called "gigdate", attached it to the the ArticleTemplate (Template Access) and then changed the sort field on the Articles Container advanced settings to "gigdate".

      I'll use the TV in ArticleTemplate and discard the default date field.

      Hopefully this will work.
        • 44140
        • 25 Posts
        Hmmm, sadly, this is not working.

        The listings in the article container will not sort (actually they won't even show!) if I try to sort by the gigdate TV whatever other setting I put in. It seems that I am drawing a blank with this approach.
          • 44140
          • 25 Posts
          Getting closer, but still too far away smiley

          I've given up trying to get the main listing to work with the articles templates since they won't use TVs. Instead I've tried getResources.

          [[!getResources? &parents=`2` &showHidden=`1` &depth=`1` &tpl=`giglisttpl` &sortbyTV=`gigdate` &sortdirTV=`ASC` &includeTVs=`1` &processTVs=`1`]]

          This will do a basic listing ordered by the gigdate TV, unfortunately all of the tag listings and archive listings still use the field variable from the Articles listing system along with archives. There are also complications over where links are pointing to ...

          If only Articles could sort using a TV :-(
            • 42046
            • 436 Posts
              • 44140
              • 25 Posts
              Quote from: absent42 at Aug 24, 2013, 07:54 AM
              Doesn't this work? https://forums.modx.com/thread/72839/how-to-use-tv-as-sort-field-in-general-of-advanced-settings-tab

              Flip, flip, flip, flip, what a waste of a morning.

              Thankyou smiley

              I hadn't realised that was what that was for (documentation anyone?).

              Still, thankyou for that!
                • 42046
                • 436 Posts
                Quick tip, I find a Google search of the forums using site:forums.modx.com brings up far better results than the built in forum search.
                  • 44140
                  • 25 Posts
                  Quote from: absent42 at Aug 24, 2013, 08:06 AM
                  Quick tip, I find a Google search of the forums using site:forums.modx.com brings up far better results than the built in forum search.

                  Yes, a good thought that, that's often the case with some websites.

                  Sadly, there is still a glitch with the archiving as it still archives by the "published" date rather than the TV sort.

                  Ah well, I can live with that for the moment.
                    • 11681
                    • 98 Posts
                    @ecadre, I may have done what you wish to do. Please see https://forums.modx.com/thread/?thread=86185#dis-post-475573
                      I looked just like that in 1964.
                      • 44140
                      • 25 Posts
                      Quote from: halfnium at Aug 24, 2013, 10:23 AM
                      @ecadre, I may have done what you wish to do. Please see https://forums.modx.com/thread/?thread=86185#dis-post-475573

                      Actually, you seem to have answered a question I hadn't asked yet ... that is, listing events from the current date to some time into the future as many be needed for a front page "widget" type thing.

                      Brilliant, MODx forum users are mind readers too :-D

                      Thankyou.

                      PS.

                      It works. This will give a list of upcoming gigs for the front page.

                      First create a new snippet called curDate with the following contents.

                      <?php
                      return date('Y-m-d H:i:s')


                      Then use it thus for an upcoming dates "widget" in your home page.

                      [[!getResources? &parents=`2` &showHidden=`1` &depth=`1` &tpl=`upcominggiglisttpl` &sortbyTV=`gigdate` &sortdirTV=`ASC` &includeTVs=`1` &processTVs=`1` &tvFilters=`gigdate>=[[curDate]]`]]


                      If you wish to limit it to, say, the next 3 months (approx, using unix time)

                      [[!getResources? &parents=`2` &showHidden=`1` &depth=`1` &tpl=`upcominggiglisttpl` &sortbyTV=`gigdate` &sortdirTV=`ASC` &includeTVs=`1` &processTVs=`1` &tvFilters=`gigdate>>[[!curDate]],gigdate<<[[!curDate:strtotime:add=`7889400`:date=`%Y-%m-%d %H:%i:%s`]]`]]


                      Excellent stuff, I've got just about everything I wanted in listing terms smiley [ed. note: ecadre last edited this post 13 years, 1 month ago.]