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

    i would like to sort resources by date (custom date template variable) in a way, that getPages (getResources) get all resources with the date of today or greater (in the future).

    any help appreciated!

    -st
      • 28343
      • 1 Posts
      hi,

      found a way to do it and post the code, might be useful..
      [[!getPage?
         &elementClass=`modSnippet`
         &element=`getResources`
         &tpl=`listTpl`
         &parents=`2`
         &limit=`10`
         &pageVarKey=`page`
         &includeTVs=`1`
         &processTVs=`1`
         &where=`{"publishedon:>=":"[[!mNow]]"}`
         &sortby=`publishedon`
         &sortdir=`ASC`
         &includeContent=`1`
         &hideContainers=`1`
         &showHidden=`1`
      ]]


      mNow is a custom snippet which gives back the current time (minus one day ..), looks like this:
      if(!isset($ts)) { $ts=time() - (24*60*60); } return $ts;