1

Is there a way to write a custom Rules Action with this conditions.

Default: Content Type X is set to create unpublished content.

RULES

Event: After saving new content

Condition: when a content of type X is created

Action: Set status to published

1 Answer 1

2

Even though your Rules question could be like an exercise for a training session like "Getting started with Rules in D7", the most recent release of Rules for D8 (= Alfa 3) does not support this yet.

However, as a work-around, you could implement the very same logic if you'd adapt the configuration of your content type X so that the default is that newly created content is published right away.

Note: if your goal is to "let anonymous users access unpublished contents" (as in your comment below this answer), then the view_unpublished module could be a possible alternative. As per its project page: it allows you to grant access for specific user roles to view unpublished nodes of a specific type.

1
  • Thanks for your quick response! Yes, I understand that. My goal is just to let anonymous users access unpublished contents. But it seems I cant achieve it by setting the view with permissions so I was thinking of Rules. I actually found this module view_unpublished that solves my problem. Apr 10, 2018 at 10:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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