1

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?

1

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

Drupal 7

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.