Needs review
Project:
Address Field
Version:
7.x-1.x-dev
Component:
User interface
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
11 Jul 2012 at 07:01 UTC
Updated:
27 Feb 2014 at 01:13 UTC
Jump to comment: Most recent, Most recent file

Comments
Comment #1
kriboogh commentedDonno if original poster is still interested, but I got this working for user contexts by patching the fieldaddress.tokens.inc file. (sorry my patch from local history isn't working in eclipse)
Replace addressfield_token_info_alter with:
Add extra checks on line 218: (line 205 originally)
This will get you extra replacement tokens in the panels replacement patterns ui, style:
%user:field-my-address:first-name
The reason i did it this way was because panels uses 'user' a a context rather then 'entity'. Also the replacement patterns in panels are restricted only to the context object, so although the addressfield tokens are available when getting all tokens, it only lists the ones for the context object, being user, entity or node. Also ctools user.inc checks if the token is a key in the context. That's why i explicitly set the extra tokens with the ':' in them.
There is probably a way better way to do it, but i needed as solution fast and haven't got time to dive into ctools/panels/tokens at the moment. Donno if this breaks anything else, it will probably bite me back somewhere in views or so, but it does what is has to do for me at the moment. Which is getting the first-name in the title of a user profile overview using panelizer in panopoly.
Comment #2
joshf commentedAttached patch of #1.
Comment #3
rogical commented