Closed (fixed)
Project:
Location
Version:
6.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
2 Jan 2011 at 19:41 UTC
Updated:
6 May 2011 at 01:27 UTC
I am using the Location Taxonomy module to allow users to select the location from the taxonomy listing. I have them adding the location information on the taxonomy term level but I do not see how I am able to display that information on the node level. The location information is not found in the $node-taxonomy array as I'd expect.
What am I missing?
Comments
Comment #1
interestingaftermath commentedsorry for the bump but I could really use a reply. I don't see what else you would need Location Taxonomy if not to display it on the node you're tagging with the taxonomy...
Comment #2
rooby commentedHey Ryan,
The location taxonomy module only really links terms to locations. It doesn't deal with display. Feel free to put in a feature request for such things.
The only thing it does have code for is to link to relevant terms for location search results when using location search (Although from a quick look at the code just now I don't believe that functionality will work either).
You can customise your node.tpl.php to print the locations.
You can get the locations from the term ID by doing something along the lines of:
You can also use theme('location', $location, $hide) to print a single location.
Comment #3
rooby commentedAlthough you probably want to do that in your template_preprocess_node and then print in your tpl.
Comment #4
interestingaftermath commentedThanks! This works great and it's exactly what I was looking for. I knew there had to be a way to call the taxonomy data but I just couldn't figure it out.
For any stumbling across this thread, here's my end result (before moving into my template_preprocess_node function. This will print out the location info + a map if you have the gmap module installed. This is prior to me theming it so it's basically just a data dump.
Comment #5
rooby commentedComment #7
Stomper commentedI have the module enabled and am trying to figure out how to use the Location Taxonomy module. I have taxonomy vocabulary with state-city-campus, I would like to link the campus to a state-city in the Location module.
Could you please give a quick rundown on how to do so. I do not want users to control how the Taxonomy term is linked to Location. I would like the admin (myself) to make the connection, once, so if a user selects a campus from the vocabulary, the state and city location will be displayed from the Location module. Additionally, if a user selects state and city from Location first, then the associated taxonomy terms will be linked.
Displaying is secondary, I just want to link them for now. A guide would be appreciated.
Thanks
Comment #8
protools commentedwhy location block don't work on term page? i use Location Taxonomy, set location data for term, but on term page block location display none ... use views for this simple task?
Comment #9
Stomper commentedI found how to do it, the location fields are on each term's configuration page within the taxonomy admin menu. Is there anyway to import bulk location data via taxonomy csv?