0

I created a comment view.

The parent content can be flagged and I want to display the comments posted since the date of the flag.

I added a hidden field "Date of creation of the flag".

I added a filter criterion (is greater than or equal to) "Date the comment was posted".

How to use the value of the flag in the filter criterion "Date of publication of the comment" ? there is no token and I have not found a module that can do that.

enter image description here

1 Answer 1

0

You could write a custom Views filter plugin to handle your use case, I have found WebOmelette's tutorials invaluable over the years, and he has a great one for D8 Views filters: https://www.webomelette.com/creating-custom-views-filter-drupal-8. This will allow you to fine tune the query to your needs and do any kind of filtering that isn't available out of the box.

2
  • I have never done this before. Can you put a sample code in your answer ?
    – user82735
    Feb 7, 2018 at 22:14
  • With the following files how to do as in my question, what should I put in github.com/upchuk/d8views
    – user82735
    Feb 8, 2018 at 19:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.