We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 46073
    • 65 Posts
    I have a group of resources (theater shows) that I'd like to unpublish automatically after a date in their TV (end date of show) so they are removed from the list of "Upcoming Shows".

    Is there an extra or snippet that can perform this action, and if so how can I implement it? PHP is not my strong point.
      • 44234
      • 219 Posts
      Do you want to remove the resources from your list of 'Upcoming Shows' or unpublish from the entire site? If it's the entire site then just fill in the 'unpublish date' under the resources settings tab.
        Find me on Twitter, GitHub or Google+
        • 46073
        • 65 Posts
        Quote from: davidpede at Feb 17, 2014, 10:59 AM
        Do you want to remove the resources from your list of 'Upcoming Shows' or unpublish from the entire site? If it's the entire site then just fill in the 'unpublish date' under the resources settings tab.

        By unpublishing the resource it's taken out of the list, is there a better way?

        I didn't even see that Unpublish Date in settings before, that might just do the trick. Is there a way to set this automatically from another TV since all the shows will already have this information provided?

        I'm trying to make it as easy as possible for the client.

        Thanks!
          • 44234
          • 219 Posts
          By unpublishing the resource it's taken out of the list, is there a better way?
          If you don't need the resource for anything else then I would just use the 'Unpublish Date' to automate it.

          Is there a way to set this automatically from another TV since all the shows will already have this information provided?
          Possibly but I would imagine you'd need to custom code a snippet/plugin to it.

          If your list is built with 'getResources' then you could look at tv filtering using 'getDate'. http://rtfm.modx.com/extras/revo/getdate#getDate-getResourcesExamplesTV You could keep the resource published put exclude them from your list based on your 'end date of show' tv being older than a certain date (ie the current date).
            Find me on Twitter, GitHub or Google+
            • 46073
            • 65 Posts
            that getDate looks perfect, my list is built with getResources. I added in the line and my list is gone, does this not look correct?

            [[getResources?
            &parents=`24`
            &depth=`3`
            &limit=`5`
            &showHidden=`true`
            &includeContent=`1`
            &includeTVs=`1`
            &processTVs=`1`
            &tpl=`showcase.tpl`
            &sortby=`menuindex`
            &sortdir=`ASC`
            &tvFilters=`EndDate>=[[!getDate:date=`%Y-%m-%d`]]`
            ]]
            


            EndDate is the name of my TV with the date.
              • 44234
              • 219 Posts
              For dynamic filtering, make sure the 'getResource' call AND the 'getDate' call are both un-cached. To cache the output, again make sure both the snippet calls are cached.
                Find me on Twitter, GitHub or Google+