Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {#
- get the correct field, but this time from the post's author ID
- we use 'post.author.ID'. For ACF that needs to be formatted to a 'user_[##]' format.
- ~ is the symbol for concatenation in Twig (whereas it's . in PHP)
- #}
- {% set group = tb.get_field( 'user' , 'user_' ~post.author.ID ) %}
- {#
- check if the group field has any length at all (if not, no point in trying to display a logo)
- To use 'group' subfields, simply use group.subfieldname
- #}
- {% if group|length %}
- {% set image = TimberImage( group.imageuser ) %}
- <img src="{{ image.src('large') }}" width="100%" alt="{{ image.alt }}" aria-label="{{ image.title }}" />
- {% else %}
- <h5>There is no field value or user not logged in</h5>
- {% endif %}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement