Create different URL alias based on CCK field So I have a typical blog entry content type and I've added a CCK checkbox for some extra functionality. I'm using the pathauto module to automatically set the URL alias for the blog entry content type.

What I would like to do is alter the URL alias created depending on the value of the CCK checkbox. If the box is checked, I'd like to change the URL alias. If not, let pathauto do it.

Possible? Can this be done in the template.php file of my theme?
I'm assuming you're well-versed in the settings that Pathauto gives you (like it's own "automated alias" checkbox, and the settings that change what happens when a node is updated).  I'm assuming those settings don't meet your needs.

This should be possible, but not in the theme layer.  You'll need to write a module, probably a relatively small one.  You'll need to implement hook_nodeapi in D6 or one of the hook_node* family in D7, and maybe hook_pathauto, to make sure the right thing happens.

Drupal 6


hook_pathauto()
hook_nodeapi()


Drupal 7


hook_pathauto()
hook_node_presave()