0

I am trying to add a rule that does something when the user views my content type "contacts", so I used the "Content is viewed of type" event to trigger the rule.

Contacts can also be added to other nodes via the Entity Reference Field. Eg. for the content type "events" you can add the contact in charge of it.

Problem is now that this rule also triggers for content type "events", cause of the "contacts" reference.

How can I prevent that?

1

It shouldn't fire because of an entity reference field..

Have you added a Content is of type condition to the rule?

Data selector: node
Value: Contacts.

Edit:

It could be that the display mode of the referenced entities is counting as a view.

Add a condition, data comparison for site:current-page:url and node:url

This will force rules to check the page url which will return FALSE for every page except the nodes's pages.

  • That is a great idea and it works. Thank you very much! – L.A. Aug 26 '16 at 14:39
  • This seems indeed a way to get the job done. But correct me if I'm wrong: it does not prevent the Rule from triggering, instead it prevents the Rules Action from being executed. Either the question needs updating, or I would add something like this to this answer ... – Pierre.Vriens Sep 10 '16 at 19:12

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.