Drupal Auto-Change Path

54 Views Asked by At

In my Drupal 7 site, I have a URL pattern set for new blog posts of [node:og-group-ref:url:path]/blog/[node:title].

I want to create a rule for one organic group that when new posts are saved for that OG, there is a rule set that the path would automatically change to [node:og-group-ref:url:path]/archive/[node:title].

Any ideas on how to do that within the Rules module?

1

There are 1 best solutions below

2
Karl Buys On

So, to answer your exact question. You CAN do it with the rules module.

Enable the rule module,

  1. Create a new rule
  2. Set "React on event" to "after saving new content" under the node heading.
  3. (optional) If you need it to match certain requirements, you could put a condition to check the values of certain token-exposed data.
  4. Select "Add action", and on the next screen select "create or delete a path's url alias".

Construct the url alias at the bottom, using replacement patterns per your original answer.

You will be able to accomplish what you asked following this methodology.

Without knowing the exact specifics of the use case, there's also a chance you can do what you're looking to do with Pathauto alone