I’ve created Template Variable that has both Input and Output types set to ’Image’.
After initially displaying, the mage referenced by the TV disappears on the rendered page. The pathway to the image is correct, but the image doesn’t display. Even navigating directly to the image fails. The image is on the server. Why won’t it display?
Setting the output type to text does not change the behavior.
What am I doing wrong?
This is my getResources tag that calls the image.
[tt][[!getResources? &parents=`8` &tpl=`animalSummaryTpl` &tvFilters=`animalType==goats` &showHidden=`1` &includeTVs=`1`]][/tt]
What about setting the output to default?
What does the TV call look like in your template?
>>What about setting the output to default?<<
I will try that.
>>What does the TV call look like in your template?<<
animalSummaryTpl
[tt] <div>
<a href="[[++site_url]]index.php?id=[[+id]]"><img src="[[+tv.thumbnailImage]]" /></a>
[[+pagetitle]]
<ul>
<li><a href="[[++site_url]]index.php?id=[[+id]]">more info</a></li>
</ul>
</div>[/tt]
Are you calling animalSummaryTpl from getResources?
Can you also post the generated HTML?
Yes, see the code in my initial post.
I have changed the getResources call to process the TV. So it is now:
[tt]
[[!getResources? &parents=`8` &tpl=`animalSummaryTpl` &tvFilters=`animalType==goats` &showHidden=`1` &includeTVs=`1` &processTVs=`1` ]][/tt]
In my ’animalSummaryTpl’ chunk, I am calling the TV like this:
[tt]
[[+tv.thumbnailImage]][/tt]
Which gets me this markup when renderd:
[tt]<img src="animals/thumbnails/thumb_arapawa.jpg" alt="*" />[/tt]
But the image does not display.
Is this path working?
www.yoursite.com/animals/thumbnails/thumb_arapawa.jpg?
If not the image is not there
Yes, I have the base href set.
You are correct, the images/ part of the URL is missing. Why would it be? Maybe the image directory setting?
I usually put my images in assets/images.
Maybe you can try this path and relink the TV
What I ended up doing was setting the TV output as default and simply adding images/ to my IMG tag in my getResources template.
I didn’t have any guidance on where to put the uploaded files when I started, so clearly I put it in the wrong place.
Does anyone know how the pathway is determined when Image TVs are output as Image?