By danieltnbaker on
I am aware that within 'Site building -> URL aliases -> Automated alias settings -> Node paths' you can create a path pattern for your content type.
Can you do this programmatically?
I am aware that within 'Site building -> URL aliases -> Automated alias settings -> Node paths' you can create a path pattern for your content type.
Can you do this programmatically?
Comments
Why do you want to do that
Why do you want to do that programatically when you can do the same thing in the user interface?
because...
It will be initiated from a custom module install on many sites, many times a day. It will reduce overhead changing the same setting with the same values for every site if I can do it programmatically.
Any ideas?
I hope you write a module to
I hope you write a module to interact with the table called 'variable' with column 'name' and it's values like 'pathauto_node_*_pattern'. Where * represents node type, for example, for page node type it's stored in 'pathauto_node_page_pattern'. Hope it helps.
excellent
Thanks msathesh, worked like a treat. I created my content types and then used variable_set to apply my autopath patterns.
Again, thank you
glad that I could help..
glad that I could help.. thanks @daniel
Code for bulk update
Here's some code I'm using with msathesh's solution. I've put my content type names and path aliases in an array which I then loop through, setting up each alias in the variable table. Thanks msathesh.
Works nicely for a single node module automated alias
Hey thanks for the discussion guys, helped me to find an answer to my own Stackoverflow question: How to change Automated alias settings on module install?