Get item array ACF json api


#1

Good morning friends, I’m developing an app to list pharmacies on duty, with wordpress, Wordpress plugin Advanced Custom Fields (ACF), Ionic 3, API Rest Json Native of Wordpress and Advanced Custom Fields (ACF) Api json.

Some fields (ACF) are repetitive, for example: professional to professional. With fields name, position, picture, phone.

These fields are inside a wordpress page.

example: page id: 17, inside has professional fields (ACF).

I need to list the professional object with its data.

Example:
Professional A,
-name
-office
-Image

Professional B,
-name
-office
-Image

Follow the json ACF and Wordpress API link

ACF Json API V3
/wp-json/acf/v3/pages/17/profissionais

ACF Json API V3
/wp-json/acf/v3/pages/17

WP Json APi V2
/wp-json/wp/v2/pages

Image


#3

Solution to list data from an array

<div padding>
   <h2>Profissionais</h2>
</div>
<ion-item *ngFor="let user of post.acf.profissionais sync">
      <ion-avatar item-start><img src="{{ user.foto }}"></ion-avatar>
      <h4 [innerHTML]='user.nome'></h4>
      <p [innerHTML]='user.cargo'></p>
      <p [innerHTML]='user.plantao'></p>
      <p [innerHTML]='user.telefone'></p>
  </ion-item>


#4
<div padding>
    <h4>Endereço</h4>
  </div>
  <ion-item *ngFor="let endereco of post.acf.endereco sync">
      <p> {{endereco.rua_avenida}}, {{endereco.numero}}  </p>
      <p> {{endereco.bairro}} </p>
      <p> {{endereco.cidade}} </p>
      <p> {{endereco.cep}} </p>
      <p> {{endereco.estado}} </p>
  </ion-item>

#5

Hi,
Thank you for your topic, it made my day :wink: