We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 25969
    • 118 Posts
    I’ve had this problem a couple of times so I thought I’d post and ask about it briefly. In a Ditto call on a set of document, theres a TV called "optImage" of type "Image", but when referenced in a template (eg, <img src="[+optImage+]" alt="" />), no value is output for it. And yes, the value is set for those documents which use a template associated with said TV, as other TV values come through fine.

    Can someone give me the reason why this wouldn’t be working, I know it’s going to be a simple and stupid one. Cheers.
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      TVs are called thusly: [*optimage*]
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 7231
        • 4,205 Posts
        I also got confused with that at first.
          [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

          Something is happening here, but you don&#39;t know what it is.
          Do you, Mr. Jones? - [bob dylan]
          • 22303 MODX Staff
          • 10,725 Posts
          Quote from: sottwell at Nov 06, 2007, 04:10 AM

          TVs are called thusly: [*optimage*]
          In a Ditto template, don’t you have to use [+tvoptImage+]?
            • 33337
            • 3,975 Posts
            Prior to Ditto 2.0.2, it needed to be prefixed with tv, but not in the latest ditto, and yes its needed to be with [+optImage+] syntax and make sure the template you are using is linked to that TV. TV names are case-sensitive.
              Zaigham R - MODX Professional | Skype | Email | Twitter

              Digging the interwebs for #MODX gems and bringing it to you. modx.link
              • 7231
              • 4,205 Posts
              Is that true of document variables as well? [+longtitle+] or [*longtitle*] in Ditto 2.0.2 template?
                [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

                Something is happening here, but you don&#39;t know what it is.
                Do you, Mr. Jones? - [bob dylan]
                • 33337
                • 3,975 Posts
                Quote from: dev_cw at Nov 06, 2007, 10:47 AM

                Is that true of document variables as well? [+longtitle+] or [*longtitle*] in Ditto 2.0.2 template?

                Yes AFAIK, better check with docs or experiment quickly .. lol, but I remember reading something like that every variable attached to the document/template is available as [+xyz+] syntax.
                  Zaigham R - MODX Professional | Skype | Email | Twitter

                  Digging the interwebs for #MODX gems and bringing it to you. modx.link
                  • 25969
                  • 118 Posts
                  Sorry I wasn’t super clear.

                  I have a Ditto template which has about 5 placeholders in it for various TVs. All but the optImage value is working so I can’t figure out why. I know how TVs relate to templates and how placeholders work in Ditto templates but this has me stumped. I’ve also done a debug run with Ditto but its a bit bung (possibly because I use Mootools in my site) so I could only download and view it. From what I could glean from the Ditto debug, no optImage was being retrieved from the DB.
                    • 6726
                    • 7,075 Posts
                    If no optImage is being retrieved from the DB, then check a few things :

                    • does the TV have a value, and if not, does it have a default value ?
                    • is the TV associated with the right template ?
                    • did you set specific document permission for that TV (or forgotten to do so) ?

                    It should work...

                    If you’re using filters in your Ditto call, also check them, they can be confusing at times...
                      .: COO - Commerce Guys - Community Driven Innovation :.


                      MODx est l&#39;outil id