Conditional message based on "start date" field

Events happening in the community are now at Drupal community events on www.drupal.org.
jstengel's picture

Scenario: I have a content type that describes an event that I want to keep visible after the start date but want to notify the visitor that the event is past the start date.

I found a module to hide the displayed start/end if "now" is greater than the start date but that's not really what I want.

I'm looking at how a "rule" might solve my problem but I'm a little lost.

What I've tried:

  • Created Component called "Expired Auction"

    • Data to compare: start-date
    • Operator value: Is Greater Than
    • Data value: now
  • Created a rule called "Auction Expired"

    • EVENTS
    • Content is viewed of type Auction
    • CONDITIONS
    • Start_Date value: now <= this seems odd, but I'm not sure what to use
    • ACTIONS
    • Set Data Value: Data: [node:title], Value: COMPLETED: [node:title]

Expected results: A visitor accesses a page with a state date that is less than "now". The page title is prepended with "COMPLETED:"

What actually happens: nothing

I feel like I'm close but something is not clicking. The value in the "CONDITIONS" area has me the most confused. It seems like it should be comparing the current start date value to what is set in the Component.

Comments

[solved]

jstengel's picture

I just needed to take the "Data to compare" field a little deeper to get to the End Date: node:field-start-date-time:value2

Thank you!

Time has come's picture

Sigh of relief!

I've been trying for days to make Rules react on cron to a date field condition and then change a value in another if the condition is met.

By following your example and starting with the reaction "Content is viewed" instead of "Cron maintenance tasks are performed", it exposed the actions I was looking for.

You can then add Cron back in as an additional action if desired.

Sometimes, Rules is a bit like black magic:)

Thank you for sharing your solution.

Rules

Group organizers

Group categories

Categories

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: