在Ionic中显示ACF转发器字段

时间:2018-12-04 15:09:16

标签: json wordpress rest ionic-framework advanced-custom-fields

我正在使用REST API将我的应用程序与Wordpress acf自定义字段相关联。当我尝试显示时,假设用户的社交媒体链接是常规的自定义字段,则它们显示正确。但是,当我尝试显示中继器子字段时,它什么也没显示。

我有一个称为书的中继器字段和一个称为URL和图像的子字段。我测试了用户REST数据,它清楚地显示了两个转发器子字段,但是以某种方式我看不到它们的前端。我不知道为什么

  <div class="social-links" text-center> 
  <a *ngIf="true || user.facebook" target="_blank" [href]="user.facebook"><ion-icon name="logo-facebook"></ion-icon></a>
  <a *ngIf="true || user.twitter"  target="_blank" [href]="user.twitter"><ion-icon name="logo-twitter"></ion-icon></a>
  </div> //This works absolutely fine

    <div class="book-list-pane" *ngIf="user.books">
    <span *ngFor="let book of user.books">
   <h1>test <a target="_blank" [href]="book.url"><img[src]="book.image"/></a></h1>
   </span>
   </div> //this displays nothing

0 个答案:

没有答案
相关问题