I have two location fields in the same node type: (1) a business' physical address and (2) countries the business services.
I'd like to theme these two location fields, specifically, moving the postcode to come after the country (not after the state/province) in (1), editing the map link to open in a new window in (1), and removing the map links altogether in (2).
The closest I've found to do this is overriding location.tpl.php, but this doesn't seem to differentiate between different locations in the same node (i.e. removing the map links from one location field removes them from all fields), and I can't seem to edit the map link at all (to put a 'target="_blank"' in there)...
Any assistance would be much appreciated!
Comments
Comment #1
Anonymous (not verified) commentedStill looking for an answer to this if possible...
Comment #2
yesct commentedI guess the module would have to generate divs like:
someone is welcome to try to edit the code to make a patch that would accomplish this. ( http://drupal.org/patch/create ) be sure to use the most resent dev version.
are you thinking you would like to have a map link on some locations but not others? I wonder if the map divs are inside the location divs like:
the map issue sounds like a duplicate of: #172646: Add div class for map links
Also, tagging to help find related issues.
Comment #3
yesct commentedtagging.
Comment #4
rooby commentedIn the latest version the map link can be set to open in a new window on the settings page (admin/settings/location). Other than that the map link is not themable. A new issue would have to be opened if you wanted that.
The location template doesn't know where it is being printed so to do content type specific things in your tpl you will have to add that information using template_preprocess_location(&$variables). In this preprocessor you could add a context variable so that in your tpl you know where you are.
You could get the node type by checking the url for a node id and then getting the type for that node and saving it to a variable in the $variables array.
Then in the template you can check that variable.
Comment #5
pedrospMy 2 cents:
Just add an Id at the top of "location.tpl.php" next to the infamous "location vcard" class.
You can then override your css.
example:
CSS: