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

Setzler’s picture

Anyone have ANY idea? No one else is having this issue?

fago’s picture

Priority: Critical » Normal

Have 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.

jjjames’s picture

I'm having this same issue! Did you ever find a solution?
Please help.
thanks :)

bomarmonk’s picture

Same problem-- trying Workflow-NG to see if that works with location tokens.

bomarmonk’s picture

Same problem with Workflow-NG, so I'm thinking this is not an automatic node title issue, but a token or location issue.

bomarmonk’s picture

I 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.

fago’s picture

Status: Active » Closed (works as designed)

agreed, looks to be issue of location tokens.

kruser’s picture

Its a problem for using cck_location too. Using something like [field_cck_location-street] results in empty values.

Anonymous’s picture

You 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]

patcon’s picture

Just 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 :)

kruser’s picture

Title: Location tokens not rendering » CCK Location tokens not rendering
Version: 6.x-1.0 » 6.x-1.2

So then there is a bug with displaying cck location tokens. I'll rename this issue.

kruser’s picture

Is this a CCK Location issue or an Automatic Nodetitles issue?

bneel’s picture

I have the same issue with rules.
B.

bneel’s picture

Project: Automatic Nodetitles » Location
Version: 6.x-1.2 » 6.x-3.0

I switch the topic to CCK location module queue

patcon’s picture

Status: Closed (works as designed) » Active

Now that it's moved, I'm going to make the issue active again

nickrice’s picture

If 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

return $node->field_my_location[0]['name'];

The set of location fields you can reference, depending on what you've got configured to allow, is:

  • ['name']
  • ['street']
  • ['additional']
  • ['city']
  • ['province']
  • ['postal_code']
  • ['country']
  • ['locpick']['user_latitude']
  • ['locpick']['user_longitude']

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.

jjjames’s picture

Great job!

patcon’s picture

HIGHFIVE!

That is all. I'm like a highfive-ninja -- leaping out of nowhere and giving highfives for being awesome.

BlackBull’s picture

Thanks :)

I been trying the codes from a while to get the right output but they weren't working
your codes did the trick

Thanks

patcon’s picture

Oh, and if you're using a mix of tokens, php and plaintext, be sure to use print instead of return, as return aborts the function that puts the title together, and so you'd only get up until the first php instance.

BlackBull’s picture

thanks Pat :)

yesct’s picture

Status: Active » Closed (fixed)

sounds 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.

yesct’s picture

Balbo’s picture

#16 does work great.
(But the issue remains)

drupalina’s picture

<?php
return $node->field_location[0]['name'];
?>

worked 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

<?php
return $node->field_location[0]['name' . ' , ' . 'city'];
?>

but that didn't work. Can anybody help with this code syntax, please?

drupalina’s picture

After 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:

return $node->field_location[0]['name'] . ', ' . $node->field_location[0]['city'];

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.

raulmuroc’s picture

Title: CCK Location tokens not rendering » Location CCK tokens not rendering in private messages
Project: Location » Privatemsg
Version: 6.x-3.0 » 7.x-2.x-dev
Category: bug » feature
Status: Closed (fixed) » Active

Tokens 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:

[current-user:profile-main:field_origin_location]

"[current-user:mail]"@hl113.dinaserver.com via metaverso.es
13:44 (1 minute ago)

to raul
Hi raul_premium,

The user super has send you the following message:

Mi propio mensaje.

When should be:

Barcelona, Spain

user@hl113.dinaserver.com via metaverso.es
13:44 (1 minute ago)

to raul
Hi raul_premium,

The user super has send you the following message:

Mi propio mensaje.

Thanks in advance.

raulmuroc’s picture

Status: Active » Closed (fixed)