We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 43406
    • 15 Posts
    I have a TV called TV_Article_Feature_Image which allows the user to choose an image to be displayed. I also want the user to be able to enter a description for this image.

    I saw an old post that mentioned that you can put a TV in the "Alternate Text:" field under Output options of the image TV. This should then output the content of that TV as part of the image tag.

    I made a TV called [[*TV_Article_Feature_Image_AltTag]] and put this in the "Alternate Text:" field under Output options of the image TV

    The Chunk looks like this:

    <div class=artlogo><a href="[[~[[+id]]]]">[[+tv.TV_Article_Feature_Image]]</a></div>


    But the output of the image tag is always Alt="" huh

    What have I done wrong?
      • 4172
      • 5,888 Posts
      what is your current getResource-tag?
      you will need to add the includeTVs and optionaly the includeTVList - properties

      and for processing the TV-outputs also processTVs and processTVList

      http://rtfm.modx.com/display/ADDON/getResources
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
        • 43406
        • 15 Posts
        Thank you for your reply.

        The getresource tag I'm using looks like
        [[getResources? &includeTVs=`1` &processTVs=`1`&tpl=`Chunk_Intro_InfoTpl`&sortby=`{"menuindex":"ASC"}`]]


        I will read up on what the other options you mentioned and give it a try.
          • 43406
          • 15 Posts
          I've finally managed to make it work!

          The GetResource looks like this:
          [[getResources? &depth=`0` &includeTVs=`1` &processTVs=`1` &includeTVList=`TV_Article_Feature_Image,TV_Article_Feature_Image_AltTag` &processTVList`H4HAU_TV_Article_Feature_Image,TV_Article_Feature_Image_AltTag` &tpl=`Chunk_Intro_InfoTpl`&sortby=`{"menuindex":"ASC"}`]]	


          The Chunk_Intro_InfoTpl chunk looks like this:
          <div class=artlogo><a href="[[~[[+id]]]]">[[+tv.TV_Article_Feature_Image]]</a></div><div style="margin-left:168px;">
          		<h3 style="line-height:1.2em"><a href="[[~[[+id]]]]">[[+pagetitle]]</a></h3>
          		<p>[[+introtext]]</p>
          	</div>


          The "Output Option":Alternate Tag: of the TV_Article_Feature_Image looks like this "[[+tv.TV_Article_Feature_Image_AltTag]]"

          The +tv.TV_Article_Feature_Image_AltTag is probaly what made it worked! Is processTVs the setting that makes it turn the TV_Article_Feature_Image_AltTag into actual text the the user entered?