Wordpress Bundle
  • What is Wordpress Bundle?
  • Getting started
    • Installation
    • Wordpress
    • Router
    • Cron job
    • Templates
  • Reference
    • Argument resolver
    • Controller
      • AdminAction
      • BlogController
      • FrontAction
      • WordpressAction
    • Entity
      • Block
      • Blog
      • Comment
      • File
      • Image
      • Menu
      • MenuItem
      • Post
      • Term
      • User
    • Repository
      • CommentRepository
      • PostRepository
      • TermRepository
      • UserRepository
    • Service
      • PaginationService
      • BreacrumbService
  • Guides
    • Server requirements
    • Install plugins
    • Use Multisite
    • Gutenberg
    • WP Steroids plugin
      • Image options
      • Maintenance
      • Admin pages removal
      • WYSIWYG Editor
      • Feature Support
      • Multi-site configuration
      • Constants definition
      • ACF configuration
      • Menu
      • Custom Post type
      • Advanced permalink settings
      • Custom Taxonomy
      • Templates
      • Page states
      • External table viewer
      • Roles
      • Optimisations
      • Security
      • Search
    • Twig Cookbook
    • Inject variables in all templates
    • Internationalization
    • Extending Wordpress Bundle
    • Error pages
    • Site health
  • Integrations
    • Advanced Custom Fields
      • Install ACF PRO
  • Extras
    • Migrating from 1.x to 2.0
    • Roadmap
    • Changelog
    • Alternatives
Powered by GitBook
On this page

Was this helpful?

  1. Integrations

Advanced Custom Fields

PreviousSite healthNextInstall ACF PRO

Last updated 1 year ago

Was this helpful?

ACF values are available under the custom_fields property

{{ post.custom_fields.subtitle }}

Return format

Image, post, term and user are converted to entity if the return type entity is selected in the field settings

Specific fields

Flexible content

Content is parsed into an array of object, acf_fc_layout is renamed as type and remaining content is included into the data property

{% for content in post.custom_fields.flexible_content %}
  {% include content['type'] ~ '.html.twig' with { data: content.data } %}
{% endfor %}

Repeater

Content is parsed into an array

{% for content in post.custom_fields.repeater %}
  {{ content.title }} {{ content.subtitle }}<br/>
{% endfor %}

Gallery

{% for image in post.custom_fields.gallery %}
  {{ image|picture(800,600) }}
{% endfor %}

Image

{{ post.custom_fields.image|picture(800,600) }}

Post object

{% set other_post = post.custom_fields.other_post %}
<a href="{{ other_post.link }}">{{ other_post.title }}</a>

Relationship

{% for other_post in post.custom_fields.relationship %}
  <a href="{{ other_post.link }}">{{ other_post.title }}</a><br/>
{% endfor %}

Content is parsed into an array of

Content can be converted to entity

Content can be converted to entity

Content can be converted to an array of entity

Image
Image
Post
Post
ACF field settings