简体   繁体   English

尝试根据日期标准隐藏在Drupal Views输出中归档的CCK

[英]Trying to hide CCK filed in Drupal Views Output based on date criteria

I am trying to conditionally hide a field on my site that links through to a Drupal node. 我试图有条件地隐藏我的网站上链接到Drupal节点的字段。 I want the image to be hidden the Display To Date (custom CCK field) is in the past. 我希望隐藏图像,以“显示日期”(自定义CCK字段)为过去。 The field name is coupon_link and it should only show if the Display To Date is >= today. 字段名称是coupon_link,仅当“显示日期”为> =今天时才显示。 Here is a link to the output so you can get a better idea ( http://www.zambux.com/coupons?field_location_value_many_to_one[]=Lake+Oconee&field_location_value_many_to_one[]=Athens ). 这里是输出的链接,因此您可以更好地了解( http://www.zambux.com/coupons?field_location_value_many_to_one[]=Lake+Oconee&field_location_value_many_to_one[]=Athens )。 The image that says "View Our Coupon" should not display if the To date is < today as the coupon would technically be invalid and should not be linked to. 如果“截止日期”为“今天”,则不应显示“查看我们的优惠券”图片,因为该优惠券从技术上讲是无效的,不应链接到该优惠券。

Thank you! 谢谢!

Assuming your view uses a Row style of "Fields", my first thought would be to check the "Exclude from display" option for the image field, then add it back in at the theme layer, by overriding one of the views templates (see Theme: Information on the Views "Edit" page). 假设您的视图使用“字段”的行样式,我首先想到的是检查图像字段的“从显示中排除”选项,然后通过覆盖其中一个视图模板将其重新添加到主题层(请参见主题: “视图”“编辑”页面上的信息)。

There may be a better way though. 也许有更好的方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM