create rules in external text editor?

We encourage users to post events happening in the community to the community events group on https://www.drupal.org.
weathersmile's picture

Hi,

In principle I understand how to make rules within D7.
In fact rules are a bit like an event based programming language for
drupal.

Is it possible to develop rules for use within drupal, but outside of drupal, e.g. using a text editor? I imagine hand-writing rules in a text file, similar to a php program and then uploading them into a running drupal instance.

Probably this also would require that uploaded rules can be edited within drupal to correct errors or change e.g. conditions.

Is this possible / supported?

thanks,

weathersmile

Comments

Yes its possible... it would

univate's picture

Yes its possible... it would require some effect to learn, so wouldn't suggest this if you are only editing rules occasionally.

In the rules ui you will find export/import options, so you can export a rule from one drupal system and import into another. You can edit that in a text file - although the slightest syntax error will likely mean you can't import it (and you probably wont get helpful errors to debug). You can also write rules in php and include as part of a drupal module.

In either case they will show up as rules you can edit in Drupal.

The rules docs have examples of both:
https://drupal.org/node/884584

Rules

Group organizers

Group categories

Categories

Group notifications

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