We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 5532
    • 251 Posts
    Hi There,

    We have a template variable named "movieimage" that we’d like to include in a Ditto chunk so the image is included in our DItto call on the home page.

    Our chunk currently looks like this (line 3 being a complete guess of course):
    <div class="movie">
    <h3><a href="[~[+id+]~]">[+title+]</a></h3> 
    <a href="[~[+id+]~]">[+[*movieimage*]+]</a> 
    </div>
    


    Is this possible - can’t seem to find any info on doing this.

    Cheers
      • 5532
      • 251 Posts
      OK - My chunk didn’t have an <img src="" /> so now have the following in my chunk called "dittomoviesumimage":

      <div class="movie">
      <h3><a href="[~[+id+]~]">[+title+]</a></h3> 
      <p><a href="[~[+id+]~]"><img src="[*movieimage*]" /></a></p>
      </div
      


      This pulls the image TV into the home page using the Ditto call but displays the image as a broken image icon?

      If I test the template variable in a template it displays the image so there must be something wrong with my Ditto call maybe - which looks like:
      [!Ditto? &parents=`6` &orderBy=`pub_date ASC` &tpl=`dittomoviesumimage`!]
      


      Any help would be much appreciated.

      Cheers
        • 5532
        • 251 Posts
        BTW If I insert the image TV into a template, the image displays so I’m sure it’s not a problem with the image itself.
          • 5532
          • 251 Posts
          Don’t know why I didn’t see this earlier but you call a TV as a placeholder like this [+movieimage+] so the code should’ve been:
          <div class="movie">
          <h3><a href="[~[+id+]~]">[+title+]</a></h3> 
          <p><a href="[~[+id+]~]"><img src="[+movieimage+]" /></a></p>
          <p>[+nowshowingdate+]</p>
          <p><a href="[~[+id+]~]">More</a></p>
          </div>
          
            • 6408
            • 58 Posts
            I know its been a while, but thanks CMS fo rsticking with this post and posting your solution - been searching on this subjec tmyself.

            Dan
              • 5532
              • 251 Posts
              Sweet as, I also post solutions so I can find them myself when I forget them!
                • 121
                • 36 Posts
                Thanks a lot for this answer, I’ve been pulling my hair out for the last 30 minutes wondering why this wasn’t working laugh