3

I have a content type called 'DVD Review' with a field called 'Release Date' which is input using the date module.

On the node page, if the release date is in the future I'd like it to say "Coming Soon", or otherwise, if the release date is in the past say "Out Now".

I'm using Display Suite to arrange the fields, so I'm thinking I could add a code field with a php if statement to handle this.

1

Please follow below instructions to add new custom code field.

  1. Go to admin/structure/types/manage/your_content_type/display
  2. Click on Add Custom Fields Vertical Tab @ Bottom of Screen.
  3. Click on Add a Code Field.
  4. Use $entity object to get Release Date based on that display the message.
  5. Enable the Code Field in right place.

Post comments if you have any Questions.

  • Thanks for the reply. I've managed to solve this using context module. I added a condition of date, which I can then select less that or greater than. – Tom Sep 13 '12 at 21:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.