Support

Account

Home Forums General Issues Unlimited Elements – {{item.post_list.cf_xxx}}

Solved

Unlimited Elements – {{item.post_list.cf_xxx}}

  • Hi there all,

    I want to make a post list displaing fields from ACF

    I have been searching for hours and always ended up in the same dead end.
    My solution always pick the content from the page listing content and not the listed items themself…

    In my Unlimited Elements widget i want to get custom fields to show for each item.

    ***Example of how listing intro looks like
    {% if show_description == “true” %}
    <div class=”postGridDescription”>{{item.post_list.intro|raw}}</div>
    {% endif %}

    For the current post there are fantastic integrations already (the one listing other posts)

    ***Example of a function that works perfectly but
    ***for the current post and not the listed items

    {{current_post.cf_work_type}}

    The above one is made by me and the custom field name is work_type

    What I am looking fo is below, a combination of getting the ACF but for the listed item.

    {{item.post_list.cf_work_type}}

    Is this possible or am I chasing the end of a rainbow?

    Best regards // Daniel

  • So… it would not be fair to not chare my progress..

    In the “inputbox ite Item HTML” the second white inputbox under the HTML tab in Unlimited Elements widget one can put this code in!

    The : {{item.post_list.id}} calls on the item ID // that differs from the current page ID
    The afc code : [acf field="name" post_id="number"] is then easily replced like below.
    The text work_type is a custom field I made in acf.

    <div class=”youclass”>[acf field="work_type" post_id="{{item.post_list.id}}"]</div>

    I would call my anser a solution if there are no objections.

  • Here’s an official tutorial from Unlimited Elements covering this exact topic.
    Also, they have a few more tutorials specific to the Advanced Custom Fields plugin.

    I ran into an additional problem trying to integrate an ACF Field-Type:Link to reference an external resource for each post. I found that an ACF link field strips off the ‘http://&#8217; when inserting it into the html item code, resulting in an invalid link. (http://www.amazon.com = www.amazon.com) to fix it I used this –

    <a href="http://{{item.post_lists.cf_your_field_name}}">

    This post was first relevant answer in my search. So I hope this helps others after me. thanks dbzOnline for your previous answer.

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.