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

    I’m having somewhat of a weird problem. I’m building a website that Ditto’s through the children of a certain page. This isn’t anything fancy, it should read out a templatevar (projectPicture), the title and the description. Funny thing: it isn’t outputting the image. I tried having the template-var output an entire image-tag, or just plain "default", but it doesn’t output anything at all.

    My Ditto-template (chunk looks like this):
    							<div class="project">
    								<a href="[[~[[+id]]]]"><img src="[[+projectPicture]]" /></a>
    								<h3>[[+pagetitle]]</h3>
    								<p>[[+description]]<br />
    								<a href="[[~[[+id]]]]">lees verder »</a></p>
    							</div>
    


    Am I missing something?

    Thanks! laugh

    SOLVED

    Ok, had to add &includeContent=`1` to the getResource call as well as includeTVs=`1`... Still don’t quite know why, but: thereifixedit smiley
      • 1778
      • 659 Posts
      Not sure that Ditto is well supported under Revo... Did you try to use GetResource instead?
      I think it’s a "Ditto like" for Revo but I not used it yet myself ?

      Hope this helps
      Cheers

      BTW - Why do you post under Modx101 if your question is about Revo ? wink
        • 28554
        • 201 Posts
        Quote from: anso at Jul 03, 2010, 03:27 PM


        BTW - Why do you post under Modx101 if your question is about Revo ? wink

        Because 101 isn’t a version-number, it means "Basics" more or less smiley
          • 28554
          • 201 Posts
          Ok, so I’ve installed and configured getResources, and the problem persists. I’ve looked at one of the actual page, and the image is being showed there, so the TV is working fine in normal page-context.

          This is my getResource call:

          [[getResources?tpl=`projectRowTpl`&parents=`1`&includeTVs=`1`&processTVs=`1`]]
          


          I’m not quite sure what includeTVs and processTVs does yet, but I’ve tried without them aswell, same results.
            • 33337
            • 3,975 Posts
            You have to prefix "tv" or "tv_" to template variable placeholders IIRC.
              Zaigham R - MODX Professional | Skype | Email | Twitter

              Digging the interwebs for #MODX gems and bringing it to you. modx.link
              • 22303 MODX Staff
              • 10,725 Posts
              See the tvPrefix property described here. The default value is tv. but you can change that (to blank even) using a property set or in the tag, e.g.
              [[getResources?
                  &tpl=`projectRowTpl`
                  &parents=`1`
                  &includeTVs=`1`
                  &processTVs=`1`
                  &tvPrefix=``
              ]]
                • 28554
                • 201 Posts
                Thanks for the response guys. I’ve fixed it by adding the standard prefix (I think adding tv. in front of the call is actually quite a good identifier so that you know where your tv’s are), and adding includeTVs AND includeContent. I’m not quite sure of why this is however (with just includeTVs it doesn’t work), can anyone shed some light on what exactly causes TVs to only be processed if you add includeContent=`1`?
                  • 14349
                  • 44 Posts
                  Working for me in RC-3 without the includeContent -

                  It took me a while getting it to work - turns out I had the wrong placeholder for the document-link - it actually killed any placeholders I had after it -
                    • 22303 MODX Staff
                    • 10,725 Posts
                    Quote from: StevenLangbroek at Jul 03, 2010, 11:31 PM

                    Thanks for the response guys. I’ve fixed it by adding the standard prefix (I think adding tv. in front of the call is actually quite a good identifier so that you know where your tv’s are), and adding includeTVs AND includeContent. I’m not quite sure of why this is however (with just includeTVs it doesn’t work), can anyone shed some light on what exactly causes TVs to only be processed if you add includeContent=`1`?
                    Because any TV tags in the content get processed?