尝试根据日期条件隐藏 Drupal 视图输出中提交的 CCK
我试图有条件地隐藏我网站上链接到 Drupal 节点的字段。我希望图像被隐藏,显示截止日期(自定义 CCK 字段)是过去的。字段名称为 coupon_link,仅当显示截止日期 >= 今天时才会显示。以下是输出的链接,以便您可以更好地了解 (http://www.zambux.com/coupons?field_location_value_many_to_one[]=Lake+Oconee&field_location_value_many_to_one[]=Athens
)。如果“截止日期”<<,则不应显示“查看我们的优惠券”的图像。今天,因为从技术上讲,优惠券是无效的,不应链接到。
谢谢你!
I am trying to conditionally hide a field on my site that links through to a Drupal node. I want the image to be hidden the Display To Date (custom CCK field) is in the past. The field name is coupon_link and it should only show if the Display To Date is >= today. 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
). 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!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
假设您的视图使用“字段”的行样式,我的第一个想法是检查图像字段的“从显示中排除”选项,然后通过覆盖视图模板之一将其添加回主题层(请参阅主题:视图“编辑”页面上的信息)。
但可能有更好的方法。
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.