1

I just upgraded EE to 2.7.1 and am having problems with my Playa (4.4.5) fields that pull in Assets (2.1.4) data. I have a 'homepage' channel with a Playa field that pulls articles from a 'features' channel, which includes an Assets field for (a single) image. Pulling any data from the Assets field (e.g., {url}) causes the template code for the Playa field to display, as if the parser has choked.

For example, this works fine (without the Assets field):

{exp:channel:entries channel="homepage"}
        {home_features}
            <article>
                <h1>{title}</h1>
                <p>{feature_summary}</p>
                <a href="{page_url}">more info</a>
            </article>
        {/home_features}    
{/exp:channel:entries} 

But this (stripped-down version) doesn't:

{exp:channel:entries channel="homepage"}
        {home_features}
            <article>
                {feature_photo}<img src="{url}" >{/feature_photo} {!-- this is the Assets field --}
                <h1>{title}</h1>
                <p>{feature_summary}</p>
                <a href="{page_url}">more info</a>
            </article>
        {/home_features}    
{/exp:channel:entries}

which displays the following on the page:

{home_features}

Homepage

more info

{/home_features}

('Homepage' is the title of the homepage channel entry)

Assets fields seem to be working fine elsewhere on the site, just not within Playa fields. I did sync directories and update indexes, fyi.

Help? Thx!

1

This ended up being an issue with variable namespacing -- the following worked:

{exp:channel:entries channel="homepage"}
        {home_features var_prefix="feature"}
            <article>
                {feature:feature_photo var_prefix="file"}<img src="{file:url}" >{/feature:feature_photo} {!-- this is the Assets field --}
                <h1>{feature:title}</h1>
                <p>{feature:feature_summary}</p>
                <a href="{feature:page_url}">more info</a>
            </article>
        {/home_features}    
{/exp:channel:entries}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.