[support] Setting URL alias based on term for feed item

Steve Edwards killshot91 at gmail.com
Thu May 13 17:05:32 UTC 2010


I have an Article content type, and my pathauto settings use a custom token ([cbb_category]) that gets the value from a single term vocabulary (called generically enough, Category), so the pathauto setting is 

[category][title-raw]

The vocabulary has four terms - Advice, News, Reviews, and Experts, so if the assigned term is News, then the path for an article node would be mysite.com/news/my-node-title.

Articles are created manually, and are also imported via the Feeds module.  The problem I have is that there is no direct mapping from the categories in the feeds to the Categories vocabulary, so that needs to be manually set (the nodes are imported initially as Unpublished).  So my question is, what would be a good way to get the URL alias set correctly?  I'm thinking something like using hook_nodeapi to set the alias when an article is saved, but I only want to do it for nodes that were previously unpublished.  

Suggestions are appreciated.

Thanks.

Steve


More information about the support mailing list