日期的 Drupal 8 上下文過濾器 (Drupal 8 contextual filter for date)


問題描述

日期的 Drupal 8 上下文過濾器 (Drupal 8 contextual filter for date)

有人知道如何在日期/時間值上使用上下文過濾器來實現視圖嗎?我有一個包含日期字段的內容類型 Event,需要以某種方式過濾特定月份內的項目。不確定是否可以在沒有特殊編程的情況下完成,如果可以的話,是通過上下文過濾器(如 node/)還是通過帶有月份列表的暴露過濾器,以便用戶自己過濾項目?

感謝TC


參考解法

方法 1:

There exists the contextual range filter module. https://www.drupal.org/project/contextual_range_filter

To the time I am writing no Drupal 8 version is shown on the module page, but there are some. Have a look in the release section "View all releases". There you can filter the API version "8.x".

You can have a look into the README.txt for all the possibilities to query. http://cgit.drupalcode.org/contextual_range_filter/plain/README.txt?id=refs/heads/8.x‑1.x

A simpler solution could be to use the build in function in views You can add special fields in the contextual filters section They are called:

  • Created year
  • Created year + month
  • Created week
  • Created month
  • Created day
  • Created date

(by Tomáš Cigáneksreher)

參考文件

  1. Drupal 8 contextual filter for date (CC BY‑SA 2.5/3.0/4.0)

#filtering #Date #drupal-8






相關問題

禁止查找和 grep“無法打開”輸出 (Suppress find & grep "cannot open" output)

directx10 中的精靈和紋理過濾 (Sprites in directx10 and texture filtering)

使用 Lucene 統計分類結果 (Using Lucene to count results in categories)

根據 URL 變量過濾 HTML 內容 (Filtering HTML content based on URL Variable)

網格列包含 int64 值,但過濾器顯示字符串並且不起作用/ (Grid column contains int64 values but filter shows strings and doesn't work/)

angularjs中的雙重過濾 (dual filtering in angularjs)

按序列順序過濾 Birt 表 (Filter in serial order for Birt tables)

日期的 Drupal 8 上下文過濾器 (Drupal 8 contextual filter for date)

在VB中過濾一個wpf collectionviewsource? (Filter a wpf collectionviewsource in VB?)

遍歷對象並返回匹配的鍵/值 (Traverse object and return matching key / values)

過濾Python列表時出現意外輸出:我做錯了什麼? (Unexpected output when filtering Python list: What am I doing wrong?)

角度:錯誤 RangeError:超出最大調用堆棧大小 (ANGULAR: ERROR RangeError: Maximum call stack size exceeded)







留言討論