1

I have two scenarios:

  1. I have a meditation content type that need to show in a view when the date field = today's date. I want a view to show a meditation every year on the same date.

  2. I need to create a new node of a certain content type every week where the date field has a start date of today's date and a relative end date of + 13 days.

How to create those two scenarios using rules? I am trying to understand rules scheduler. I think it can solve both scenarios.

1
  • You haven't asked a question here. You've listed some criteria for a view, and I'm not sure sure about the 2nd scenario. In both these scenarios, you've not explain how they relate to the title of question.
    – Shawn Conn
    Sep 15, 2015 at 2:41

1 Answer 1

0

Create a new node of a certain content type using rules

Use rules action "Create entity" to create a node, whereas "node" is a type of entity.

For the fields that you want to provide some value for (as part of your rules action), make sure to add a Rules conditions - "Entity has field" (with the field corresponding to each such field). Doing so will ensure they are available in the Rules action (to set a value for it).

Repeat the creation of such new node

Use the rules scheduler as explained in the video about "Repeating scheduled events". The "clue" here is:

  • as the last action of your rule, you reschedule the same rule to be executed again after +13 days from today on. Or maybe execute the rule again "weekly" (as per your details in "2.").
  • the very first time (today + 13 days) you need to trigger the execution of this rule manually (from the rules UI). Since there doesn't seem to be any event in your question that you can use to trigger this rule.

Video tutorials

If you're not familiar (enough/yet) with Rules, checkout the 32 (!!!) great, and free, video tutorials Learn the Rules framework, organized in 7 chapters.

PS: Your question seems to contain 2 questions, of which "1." is not clear to me (something about creating a view?). After you enhance your question (as suggested by Shawn also), I might enhance my answer also.

2
  • Thank you for the comprehensive answer.<br> for question 1: I have added 365 content of a node type meditation. I have a view that shows only one meditation which is today's meditation. for example: today's meditation is 9/18/2015. I need this content to show in this view on 9/18/16, 9/18/17, etc. So I was thinking maybe I need to sort the meditation by publish date and execute a rule that unpublish each meditation after 364 days of publishing it and another rule to publish each meditation after 1 year of publish.
    – yogi Moh
    Sep 18, 2015 at 13:00
  • For Question 2 How can I use rules to create a new node and schedule it so that it publish after 13 days at 5 am or every other Monday at 5 am? I watched the video and I am still trying to figure it out.
    – yogi Moh
    Sep 18, 2015 at 13:14

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