When you create a 1:M relationship and are in the child entity, you can't seem to access the parent's post_thumbnail property.
Example.
Two pods. Department ( parent ) and test_person ( children )
Create thedepartment
with a featured Image and a relationship withtest_person
test_person
with a link to department
test_person
department
doesn't show up. (ToT) 👎If you noticed, it doesn't show up in the reference or autocomplete either, which is potentially where the issue is.
Temporary fix would be... don't use Featured Image and add an Image field... though post_thumbnail
is such an integral part of the whole WP ecosystem that it seems silly to not support that.
Is it possible that this was done intentionally to avoid an extra database table join?
Here's the template code I used:
<h1>{@post_title}</h1>
<p>Department Image Path:
{@department.post_thumbnail}
{@department.post_thumbnail_url}
{@department.post_thumbnail.thumbnail}
{@department.post_thumbnail.medium}
</p>
{@post_content}
you could try
[each department]
{@post_thumbnail.url}
[/each]
which works for me all to well i got the image 24 times :P i rarely use the templates maybe i have time later on to dig deeper or somebody else jumps in ^^
That's still an issue - traversal is broken for any related pod like ( 1:M and 1:1 and n:m )
related_pod.post_thumbnail
or
related_pod.post_thumbnail.ID
Related Pods (multiple select) work in an [each related]{@post_thumbnail}[/each]
block, so this is strictly limited to the traversal of post_thumbnail helper in traversals.
Workaround from jim - use multiple select and limit to 1
I can confirm this is an issue, even with Pods 2.7 RC1. The Template reference doesn't appear to extrapolate _anything_ from the single select relationship, but single_relationship.post_title
outputs properly but the single_relationship.post_thumbnail
doesn't.
ran into this again :/ it surfaced twice for the BB Integration!
book_author relationship field to another CPT 1:m -> 3 related items bidirectional assigned!
portrait is a single select image! would expect both to work the same - weird it returns always a string for the first image and nothing for the rest
@quasel
To reply on your last comment.
Traversal over multiple selects simple isn't (and shouldn't be) possible like that.
At least not for magic tags...
The actual issue of this topic is fixed in #5610