These days there is a 7.x release of the Node Expire module, however you can also use the Rules module, as further explained below.
Part 1 - Unpublish the node
Use the Rules module together with Rules Scheduler
(a sub-module of it), as explained in the steps below. These steps are based on the assumption that your content type is article
(adapt to whatever else fits).
Step 1: Create a field to store the expiration date
Add a field to the article content type (to store the "expiration" date), with these specs:
- Machine name (say)
field_expiration_date
.
- Use "date" as field type, for which the date module (and data API) needs to be enabled first.
- Allow only 1 date.
Step 2: Create a Rules Component
Here is the Rules Component to be created (in Rules export format, just import it in your own environment via copy-paste):
{ "rules_unpublish_a_node" : {
"LABEL" : "Unpublish a node",
"PLUGIN" : "rule",
"OWNER" : "rules",
"REQUIRES" : [ "rules" ],
"USES VARIABLES" : { "node_to_be_unpublished" : { "label" : "Node to be unpublished", "type" : "node" } },
"DO" : [ { "node_unpublish" : { "node" : [ "node-to-be-unpublished" ] } } ]
}
}
Step 3: Create a Rule using the Rules Component
Here is the Rule to be created, in Rules export format (just import it in your own environment via copy-paste, then "enable" the rule also):
{ "rules_schedule_the_unpublish_of_a_node_as_requested_by_author" : {
"LABEL" : "Schedule the unpublish of a node as requested by author",
"PLUGIN" : "reaction rule",
"ACTIVE" : false,
"OWNER" : "rules",
"REQUIRES" : [ "rules", "rules_scheduler" ],
"ON" : { "node_insert--article" : { "bundle" : "article" } },
"IF" : [
{ "entity_has_field" : { "entity" : [ "node" ], "field" : "field_expiration_date" } }
],
"DO" : [
{ "schedule" : {
"component" : "rules_unpublish_a_node",
"date" : [ "node:field-expiration-date" ],
"identifier" : "Unpublish-node-[node:nid]",
"param_node_to_be_unpublished" : [ "node" ]
}
}
]
}
}
Note that the above rule refers to the Rules Component from the previous step. Make sure to only perform the import of this rule only after you completed step 1, if not the import will fail ... Should you want to use another machine name, then change field_expiration_date
in the rule above to what you prefer, prior to importing this rule.
Be aware: the above rule is only triggered once, i.e. when the node (of type article) is first created (as in the question). It will right away schedule the unpublish of the node (as requested in the expiration date). If the node gets edited later on, and/or the expiration date is changed afterwards: too bad, that won't change anything to when the scheduled unpublish is going to happen. Also, from the question it isn't really clear if the expiration is optional or mandatory, so if needed make the expiration date a mandatory field.
Part 2 - Move to archive
Your question doesn't really explain what you mean with "move to archive". Maybe just "unpublish" is already sufficient to consider it as archived right away. If not, you could use the Flag module. It would be straight forward to also flag the node via an additional Rules Action that you add to the above Rules Component.
And with those "flagged" nodes, you can then select from various approaches to actually implement such move to archive. Just to mention a few: