We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 19873
    • 67 Posts
    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]
      • 5340
      • 1,624 Posts
      What about setting the output to default?
      What does the TV call look like in your template?
        • 19873
        • 67 Posts
        >>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]
          • 5340
          • 1,624 Posts
          Are you calling animalSummaryTpl from getResources?

          Can you also post the generated HTML?
            • 19873
            • 67 Posts
            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.
              • 5340
              • 1,624 Posts
              Do you have the base href in your template head section?

              <base href="[[++site_url]]" />
                • 5340
                • 1,624 Posts
                Is this path working?

                www.yoursite.com/animals/thumbnails/thumb_arapawa.jpg?

                If not the image is not there
                  • 19873
                  • 67 Posts
                  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?
                    • 5340
                    • 1,624 Posts
                    I usually put my images in assets/images.
                    Maybe you can try this path and relink the TV
                      • 19873
                      • 67 Posts
                      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?