We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 25876
    • 79 Posts
    Hello there,
    I’ve got (i guess) a pretty newbish question concerning Template Variables and Chunks;

    I created a ditto call and i want to use some small images on every list-item, but they need to change of course for every document.

    So, i created a TV named refimg and chose "Text" for EntryType and "Image" in the second DropDown menu and the file path (assets/templates/folder/img.jpg) as standard value.
    So, then in my Ditto-Template-Chunk it goes like:

    		<div class="referenzimg">
    			<a href="[~[+id+]~]">[*refimg*]</a>
    		</div>

    and it shows me the image as i wanted.
    BUT, if i change the TV-value on a document like "assets/templates/folder/second_img.jpg" it keeps showing me the standard image all the time!

    What do i have to do that it shows me different images?

    Thanks for your help!
      • 17883
      • 1,039 Posts
      Should be:

      <div class="referenzimg">
      <a href="[~[+id+]~]">[+refimg+]</a>
      </div>

        • 25876
        • 79 Posts
        Quote from: MadeMyDay at Mar 13, 2007, 06:41 AM

        Should be:

        <div class="referenzimg">
        <a href="[~[+id+]~]">[+refimg+]</a>
        </div>



        No, tried this before, but with + instead of * the images just totally disappear ...
        Also do simpel text-TV’s ...
          • 11975
          • 2,542 Posts
          which version of ditto are you using ?
          and what is your call

          :-)
            Made with MODx : [url=http://www.copadel.com]copadel, fruits et l
            • 25876
            • 79 Posts
            I’m using Ditto 1.0.2, MODx 0.9.6 RC1 and my call as follows

            [!Ditto? &startID=`5` &summarize=`10` &trunc=`0` &displayArchive=`0` &hideFolders=`0` &dateFormat=`%A%e %B %G` &tpl=`referenzen`!]


            hope this helps!
              • 7455
              • 2,204 Posts
              if you use an older version you need to call the tag like this [+tvrefimg+] and make sure that the tv also exist on the document that you are using the ditto call on, the tv does not need to be filled or placed on the page itzelf but in needs to be atached to the template that document is using if not that you need to set extra paranmeters to show hiddentv’s.
                follow me on twitter: @dimmy01
                • 11975
                • 2,542 Posts
                I would recommend to upgrade ditto to 2.0

                Anyway with this version the tv in chunk must be prefixed with "tv"


                <div class="referenzimg">
                <a href="[~[+id+]~]">[+tvrefimg+]</a>
                </div>

                Should do the trick but if it doesn’t work have a look to the snippet params.

                :-)

                  Made with MODx : [url=http://www.copadel.com]copadel, fruits et l
                  • 25876
                  • 79 Posts
                  hell yea, thanks for your help guys, its working now!

                  It’s been just the two letters, "tv" prefixing the TV name and all went good ...