1

Situation :

  1. I have added few more fields in user registration form using account settings->manage fields. The type of the field is cck address field.

  2. I created a new view as json document, and I added that field to the view as well, but the problem is its not expanding it as the way I wanted. What I mean is, I filled the user registration form address field as first name, last name, street etc etc. but I am either seeing the whole field in a single line under Address tag in json or just a tag like this {"nodes":[{"node":{"name":"admin","field_address":"1"}}]} but what I want is like this:

    {"nodes":[{"node":{"name":"admin","first_name":"xyz","last_name":"sdas","street":"ssdsf"}}]}

Any suggestions?

1

I also had the same issue with Addressfield module. There is a long discussion here regarding this issue. You can find two solution for it by the patch provided by some members.

  • This one works by field formatter modification.

If you apply this patch, add the address field to a view and then you will see in the Formatter drop down all the components of the address is listed. (where before it just said Default).

  • This one works by adding data by field_view_data.

If you apply this patch then you can add the addressfield component in the add field itself. You will have option to add by searching something like "Content:Address(COMPONENT MACHINE NAME)

| improve this answer | |
  • but could this be done with Location module? – mad_programmer Aug 18 '13 at 11:37
  • @mad_programmer Please post a separate question for Location components. Let me see it.. – RajeevK Aug 18 '13 at 11:39
2

Current version of Addressfield (7.x-1.0-beta5) supports displaying address components in views as separate fields.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.