Closed (fixed)
Project:
Addressfield Tokens
Version:
7.x-1.0
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
5 May 2012 at 22:35 UTC
Updated:
22 Jun 2012 at 02:21 UTC
Hi,
this is kind of a small feature request :-D
Is it possible to get only city as a token and field renderer, instead of City, State?!
Best regards,
Tobi
Comments
Comment #1
amarcus commentedThe city is already available as a token (called "Locality" by default, unless you change it).
However, what is your specific use case for a city-only field renderer? We have found that within templates it is fairly easy to display a single component from the render array; the harder part was consistently rendering multiple components separated by commas so those were the ones we built field renderers for. Within views, I believe the addressfield module already provides view field handlers for each component of the address, so no need to use a field formatter there.
In the generic case, we could build a field renderer for every component of an address. But this may be cumbersome to actually use... But I welcome your thoughts on the matter.
--
Andrew
Comment #2
DerTobi75 commentedAh, ok, I can use the token for rewrites in my View!
My problem with the addressfield renders in the node display, I need a complete address, but only want to display the city, when a user views the node or a view.
Comment #3
amarcus commentedTobi,
I just added a new field formatter that allows you to select which components you wish to render, along with a separator to use between the components. I believe that this should handle your specific case, as well as some of the more generic cases requested in the addressfield issues queue.
Try it out!
--
Andrew
Comment #4
DerTobi75 commentedHi Andrew,
thanks for the new field formatter, it works for me! Sorry for the delay.
Best regards,
Tobi
Comment #5
amarcus commentedComment #6
j4 commentedHi,
Sorry to open this again, but i need a comma only after city, while I want spaces after thoroughfare, premise, and in between State and Zip Code. Is this at all possible?
Thanks!
Jaya
P.S in case someone comes here looking for the same thing..i used spaces as the separator and used for adding the comma..
span.locality:after {
content: ",";
}
Dont know if this is right! this just worked for me.