Closed (fixed)
Project:
Location
Version:
6.x-3.x-dev
Component:
Code
Priority:
Critical
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
8 Aug 2007 at 20:20 UTC
Updated:
24 Nov 2009 at 14:59 UTC
Jump to comment: Most recent file
Comments
Comment #1
tom friedhof commentedHere is the patch for location module to call the file attached above.
The extension for the file above needs to be changed from .txt to .inc to work.
Comment #2
gemini commentedUploaded the inc file and patched the location.module - can't get it to work. Generated URLs display token names.
Comment #3
robloachModified version of your location_token.inc to use a new naming system (location- prefix), as well as the addition of
[location-provincename_N]and[location-countryname_N].[location-provincename_N]outputs the location's English province/state name (Ontario), and[location-countryname_N]outputs the location's English country name (Canada).Of course, you'll have to rename location_token_2.txt to location_token.inc.
Comment #4
robloachFixed for checking if there is a Location field active on the content type.
Comment #5
jacinesubscribing :)
Comment #6
xerbutter commentedThanks for the token module integration. It works great, except that for me [location-province_N] shows up as us-MA (for Massachusetts, for instance) and [location-provincename_N] does not work at all (because it's being fed "us-MA", but expecting just "MA" I think).
Any thoughts?
Thanks for your help.
Comment #7
xerbutter commentedJust wanted to add that
print $node->locations[0]['province']prints out "MA", so I'm not sure where the us- is getting added.Comment #8
Zoologico commentedTracking.
Drupal and the people associated with it just rock.
Thanks.
Comment #9
Zoologico commentedWhat are the steps to get this working?
1) Download HEAD version of location?
2) Add location_token.inc to location folder
3) Add token_support.inc to token folder
4) Enable/update modules
Should this work after these steps?
Comment #10
robloachGreggles submitted a patch, which will have to be merged with the current patch (addition of
check_plain).Comment #11
bshensky commentedAlso tracking. Great for using with auto-title, once we can all get it to work... Go Greggles Go!
Comment #12
jody lynnI added check_plain around all the token values and got rid of the location_tokens.inc approach so that this is now just one patch for location.module. So far it's working for me.
(For other fools like me, you have to be updated to pathauto 5.2 to even be using tokens!)
Comment #13
robloachLooks good!
Comment #14
bdragon commentedCommitted to HEAD, thanks all!
Comment #15
ellanylea commentedI applied the patch in Comment #12 above (ie added the lines that start with + to location.module), but I get the token names [location-city_N] [location-country_N] and not Montreal, Canada.
I'm using the latest: Drupal 5.7, Pathauto 5.x-2.1, Token 5.x-1.10, Location 5.x-1.x-dev (which is the 5.x-2.x branch as of 2007-Oct-31).
I know work is going into Location 3, and love the Drupal community for it! For now, does anyone know how to get token integration to work on a live site with 5.x-1.x-dev?
Thanks so much!
Comment #16
ellanylea commentedAnswered my own question, in case it could help others: the problem was not in patching, but in my implementation.
I'm using autonodetitle, so I usually just copy & paste the "Replacement patterns". The location Replacement pattern looks like [location-country_N] and says "If there are multiple locations per node, N is the iteration, starting with 0".
Since I only have one location per node, I assumed the default Replacement pattern would work... but it didn't. Once I used [location-country_0], everything was peachy!
Thanks Tom, Lynn, Rob for the patch, consolidating the patch, and the commit :)
Comment #17
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #18
elvis2 commentedThank you for pointing this out. I too am using auto node title module, and could not get location names when using [location-name_N] as the token. But using [location-name_0] did work.
Thanks!
Comment #19
kruser commentedI'm getting empty values when using cck_location. Any of the following produce empty node_autotitle values...
[field_cck_location-name] Location name
[field_cck_location-street] Street location
[field_cck_location-additional] Additional
[field_cck_location-city] City
[field_cck_location-province] State/Province
[field_cck_location-postal_code] Postal code
[field_cck_location-country] Country
[field_cck_location-fax] Fax number
[field_cck_location-phone] Phone number
[field_cck_location-province_name] Province name
[field_cck_location-country_name] Country name
[field_cck_location-map_link] Map link
[field_cck_location-coords] Coordinates