0

I've got a rule set which publishes a node based on some condition. This is working great. Now I would like to also promote that node as the front page (not publish it in the front page): in other words, I would like to automatically change the drupal front page alias to the newly created node.

Do I need to create a custom PHP action in my rule set which will update the database ? Is there a simpler way using default rules actions ?

apaderno
  • 28,547
  • 16
  • 75
  • 90
jonjbar
  • 3,896
  • 1
  • 25
  • 46

1 Answers1

1

Rules comes with a rule for "Execute custom PHP code", which you could use to make this rule. The front page is saved as a variable with name "site_frontpage", so the custom rule code should be something very simple like this (untested):

variable_set('site_frontpage', $node->path);
Scott Reynen
  • 3,530
  • 18
  • 17
  • Great suggestion, thanks! Instead of $node I'm using the $publish_content__content provided by the rules module. – jonjbar Jan 01 '11 at 09:31