I'm creating an event calendar supporting private events. If an event is private, several fields will be hidden from users (other than the author) and the node title will be displayed as "Private event". The title is stored normally.
My problem: I also need to mask the true event title in other places, like the node's URL alias, and I need to know how to force pathauto to generate an alias based on "Private event" instead of the true node title. (The URL alias pattern for events is event/[title-raw] .) So:
- If I create a private event titled "foo", I want its URL alias to be "event/private-event".
- If I create a second private event titled "bar", I want its URL alias to be "event/private-event-0".
I can't change $node->title to "Private event" in nodeapi ('save" $op) — that would generate the desired alias, but the node would be saved without its true title. I have a feeling that I should call a pathauto function in the 'insert' and 'update' stages that would regenerate the newly-saved node's alias, but based on my fake "Private event" title. Is there a pathauto function I could use that would do this?
Thanks!
Comments
Comment #1
dave reidIf you upgrade to the latest version to Token you can use hook_token_values_alter() to alter the output of certain tokens for certain nodes.