kirby-subpagelist icon indicating copy to clipboard operation
kirby-subpagelist copied to clipboard

filterBy date - pages older than now

Open iskrisis opened this issue 7 years ago • 2 comments

I would like to show only pages that have date older/newer than today.

  archived_events:
    label: Archived events
    type:  subpagelist
    filter:
      visible: true
      filterBy: date
      filterMethod: >
      filterValue: time()

Does not seem to do anything.

How to set filtervalue properly? And maybe i need escape filter method?

iskrisis avatar Feb 13 '17 14:02 iskrisis

Thanks for reporting. Unfortunately time() does not work here, because the content of the file is parsed as yaml and not as php. I will try to find a solution for this …

To use > as filterMethod you need to use quotation marks like this …

filterMethod: '>'

Since this will also work for the other methods I will update the docs accordingly.

There's also an issue with using integers as filterValue, but I found a solution for this. I will do some more testing and then push an update as soon as possible.

flokosiol avatar Feb 14 '17 16:02 flokosiol

Oh thats strange. I am so sure i saw the usage of it somewhere like this. Although its very unusual in kirby world it is used like this with grav cms. Maybe thats why i got it mixed.

The question is - is it kirbys limitation - it just spits out strings which are imposible to execute? I dont know enough about kirbys insides but this would be highly useful to me so i guess its time to fork and try.

Thx! 👍

iskrisis avatar Feb 14 '17 17:02 iskrisis