Add Rule After Login - Unpublished Content Requiring Review

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

Hi There.

I successfully added a Rule -- ON event User has logged in, DO show a configurable message on the site.

Basically, I want to add logic to this -- show message IF there is unpublished content. I allow anonymous users to submit a specific node, and admins can choose to publish or delete the content after reviewing. I already have a notification email that goes out, this is just another feature I would like to add.

Does anyone know what PHP code I could use to evaluate "IF unpublished content exists AND node type = customtype" ?? Rules is telling me that the content nodes are not configurable for the action I am using, but it makes it sound like there is a way:

"The following conditions aren't available in this context because they require arguments that don't exist in your rule. If you want to use any of these conditions, you must first add some action that adds variables of this kind in a previous rule, or have an event that passes the required variables."

Any suggestions are appreciated....Thanks!

Comments

I Don't know too much about

el_reverend's picture

I Don't know too much about rules yet, but I think you can use the rules sets to achieve this. Also Triggered rules can have AND or OR operators so this might work with a 'simple' triggered rule.

Yeah, there are limitations

barckhoff's picture

Yeah, there are limitations with with what actions you can do based on which triggers you select -- it has to be the same object type. So, if you're triggering on a user object, you won't be able to perform an action on a content object.

It might be easiest to simply display your message in a block, either with custom PHP code or using a view of the unpublished content type. The block can be displayed/hidden based on user roles.

Rules

Group organizers

Group categories

Categories

Group notifications

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