I have my node setup using a location field, and have some required values for each node, including city.

I would like to be able to use that value in the URL as a token for pathauto, so that all nodes created will have their city in the URL as a single slug. Example:

/content/vancouver/title
/content/seattle/title
/content/london/title

However this does not seem to be possible, I notice in the token list there is:

[node:field_address]

Which is my entire location field, but I do not want the entire field, only the city, or a single piece.

There is also all of the [node:location:x] tokens, but those only work if the nodes were set up using node locations and not as a separate field. Is it not possible to have the [node:field_address] broken up into different tokens like the [node:location] tokens are?

Comments

trevorleenc’s picture

I have been wondering about this myself...

Please help.

Thanks.

sprucemoose’s picture

Im stuck on this one too. Any suggestions?

Alauddin’s picture

Issue summary:View changes

Using custom formatters you should be able to break down the location field into the required pieces.

https://drupal.org/project/custom_formatters

you should try this with locations dev version as that's the one supporting tokens

https://drupal.org/node/1056154