I get this:
[location-street_N] [location-additional_N] [location-city_N] [location-province_N] [location-postal_code_N]
...as the title.
I am using this with pathauto and gmap, which uses the location API.
I get this:
[location-street_N] [location-additional_N] [location-city_N] [location-province_N] [location-postal_code_N]
...as the title.
I am using this with pathauto and gmap, which uses the location API.
Comments
Comment #1
Setzler commentedAnyone have ANY idea? No one else is having this issue?
Comment #2
fagoHave a look in the token or location module issue queues. Perhaps the tokens have troubles with the node passed by auto nodetitle, which is fresh created and might not be saved to the db yet.
It's for sure not critical as it's only about location module tokens.
Comment #3
jjjames commentedI'm having this same issue! Did you ever find a solution?
Please help.
thanks :)
Comment #4
bomarmonk commentedSame problem-- trying Workflow-NG to see if that works with location tokens.
Comment #5
bomarmonk commentedSame problem with Workflow-NG, so I'm thinking this is not an automatic node title issue, but a token or location issue.
Comment #6
bomarmonk commentedI figured out the issue from this post: http://drupal.org/node/165678#comment-769378 It looks like copying and pasting the token pattern doesn't work for single locations.
Comment #7
fagoagreed, looks to be issue of location tokens.
Comment #8
kruser commentedIts a problem for using cck_location too. Using something like [field_cck_location-street] results in empty values.
Comment #9
Anonymous (not verified) commentedYou may be entering the token incorrectly.
This is wrong:
[location-street_N] [location-additional_N] [location-city_N] [location-province_N] [location-postal_code_N]
N should be replaced with the location number you are trying to access. If you only have one location attached to a node, it would be
[location-street_0] [location-additional_0] [location-city_0] [location-province_0] [location-postal_code_0]
Comment #10
patcon commentedJust to chime in, but I had location working fine when I was using node location, but when I tried switching to cck locations (to have better control of field permissions), I couldn't get it working. So if it'll work for you, jump back to using node location and you should be able to get auto titles working :)
Comment #11
kruser commentedSo then there is a bug with displaying cck location tokens. I'll rename this issue.
Comment #12
kruser commentedIs this a CCK Location issue or an Automatic Nodetitles issue?
Comment #13
bneel commentedI have the same issue with rules.
B.
Comment #14
bneel commentedI switch the topic to CCK location module queue
Comment #15
patcon commentedNow that it's moved, I'm going to make the issue active again
Comment #16
nickrice commentedIf you are able to use PHP on your site, as a workaround you can use it to pull out the location name etc from the CCK field:
- Switch on php via the 'Evaluate PHP in pattern' under 'replacement patterns' within the 'Automatic title generation' section at the top of the edit content type page (You need PHP filter turned on in modules for this);
- If you have a CCK location field called field_my_location, say, then you can use the name as the title with
The set of location fields you can reference, depending on what you've got configured to allow, is:
The [0] is for the first my_location field set. If you have more you could use a different index.
Pathauto seems to work fine with this.
I was scratching my head for ages on how to achieve this so hopefully this will short-circuit the process for someone else.
Comment #17
jjjames commentedGreat job!
Comment #18
patcon commentedHIGHFIVE!
That is all. I'm like a highfive-ninja -- leaping out of nowhere and giving highfives for being awesome.
Comment #19
BlackBull commentedThanks :)
I been trying the codes from a while to get the right output but they weren't working
your codes did the trick
Thanks
Comment #20
patcon commentedOh, and if you're using a mix of tokens, php and plaintext, be sure to use
printinstead ofreturn, as return aborts the function that puts the title together, and so you'd only get up until the first php instance.Comment #21
BlackBull commentedthanks Pat :)
Comment #22
yesct commentedsounds like a work around was found.
If there is still a problem, please try the most recent new official release, or the dev release and post back, making sure to change the status back to active. Thanks.
Comment #23
yesct commentedis this a duplicate of #330197: Location tokens are not always available/formatted?
Comment #24
Balbo commented#16 does work great.
(But the issue remains)
Comment #25
drupalina commentedworked for me! Thank you nickrice!
But in my Titles I want the pattern to be "LocatonName, LocationCity". So how do I insert that comma "," and also "City" -- all in one line???
I tried the following
but that didn't work. Can anybody help with this code syntax, please?
Comment #26
drupalina commentedAfter fiddling with php syntax and various combinations for a while, I finally got to it work. So, I'm posting an answer to my own question, in case someone else needs it in the future. This code worked for me:
I don't know if this is good code and whether it will be okey in terms of scalability/efficiency, but at least it works.
Comment #27
raulmuroc commentedTokens doesn't render in "subject" and "body" by default. So I mean those configured at ../admin/config/messaging/privatemsg/settings.
For example:
If I put the token [current-user:profile-main:field_origin_location] in the subject or body by default of private messages, the gotten mail/message is:
When should be:
Thanks in advance.
Comment #28
raulmuroc commented