0

Having difficulties pulling back the correct image for related entries. It's pulling back the same image as the main entry and not the related entries image.

{exp:channel:entries
channel="{news_channel}"
dynamic="no"
limit="3"
url_title="{segment_2}"
parse="inward"
}

{exp:tagger:related entry_id="{tagger:entry:id}" url_title="{segment_2}" custom_fields="news-heading|news-summary"}

    <img src="{news-thumbnail:medium}" alt=" "/>
    <h2>{tagger:news-heading}</h2>
    {tagger:news-summary}{/exp:trunchtml}</p>

{/exp:tagger:related}
{/exp:channel:entries}

Tried using {tagger:news-thumbnail:medium} also but still no luck.

0

Not all custom fields will work. Unfortunately several fieldtypes rely on secondary tables in the db. You will need to embed another entries tag to make it work. For example:

    {exp:channel:entries
channel="{news_channel}"
dynamic="no"
limit="3"
url_title="{segment_2}"
parse="inward"
}

{exp:tagger:related entry_id="{entry_id}" url_title="{segment_2}" custom_fields="news-heading|news-summary"}

    {embed="news/.related" id="{tagger:entry_id}"}

{/exp:tagger:related}
{/exp:channel:entries}

Then on your .related template

 {exp:channel:entries channel="news" entry_id="{embed:id}" dynamic="no"}
    <img src="{news-thumbnail:medium}" alt=" "/>
    <h2>{tagger:news-heading}</h2>
    {tagger:news-summary}{/exp:trunchtml}</p>
{/exp:channel:entries}

Also you had {tagger:entry_id} in your inner loop, not sure how your code worked at all.

Brad

| improve this answer | |
0

Thanks Brad, much appreciated :)

For reference I needed to remove the tagger: off the custom fields in the embed for them to show. But all working :)

{exp:channel:entries channel="news" entry_id="{embed:id}" dynamic="no"}
    <img src="{news-thumbnail:medium}" alt=" "/>
    <h2>{news-heading}</h2>
    {news-summary}
{/exp:channel:entries}
| improve this answer | |

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.