times / acf-to-wp-api

Puts all ACF fields from posts, pages, custom post types, attachments and taxonomy terms, into the WP-API output under the 'acf' key

Home Page:http://wordpress.org/plugins/acf-to-wp-api/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

I can't access to the data from a "Flexible Content" ACF json object.

t0t opened this issue · comments

Hi,
I'm trying your plugin but I can't access to the data from a "Flexible Content" ACF json object. I can console.log the filelds but can't show totally them in the view.

{{ product.meta }} or {{ product.meta }} returns the array I need, but I can't deep more. Once there, how can I access to the keys/values from that array?

thanks for this great plugin!,
s.
captura de pantalla 2015-05-14 a las 20 05 56

It's hard to tell exactly @t0t, can you share some more of the code for productos.html?

It looks like the data is all there (via this plugin), but the way you're accessing it in AngularJS needs some tweaking.

Hey thanks for reply!
Yes, the data is all there, I'm so close to do amazing things... but as web designer I'm a beginner with Angular and MVC's. I'm learning as fast as I can.
Wp-api has changed the paradigma of traditional WP themes and your plugin is the bridge between WP-API+ACF.
I would really appreciate your help on this if you can take a look.
I've pushed this theme here:
https://github.com/t0t/maderlim/tree/3

Do you know any wp-theme using wp-api/angular? I like this: https://github.com/1fixdotio/angularjs-demo-theme
;)
s.

It looks like acf.product is an array, so when you're accessing product.vistas you actually need to access acf.product[0].vistas, or, more likely, as there may be multiple objects in that array, you should iterate over acf.product.

Let me know if you've been able to sort it. I'll close this issue though as it's not directly a problem with the plugin itself.