We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 12941
    • 87 Posts
    This is my first attempt at using Revolution 2.0. We’re supposed to use this instead of Ditto, now right?

    So why on earth is this not displaying anything? It’s not even like the TV thing isn’t working, it doesn’t display PERIOD. Where there should be something, there is nothing. Zip, nada, zilch.

    TV name: portfolio-image

    getResources call
              [[!getResources? 
                &parents=`[[*id]]` 
                &showHidden=`1`
                &tpl=`portfolio-slider` 
                &includeTVs=`1` 
                &processTVs=`1` 
                &tvPrefix=``
              ]]
    


    portfolio-slider template
    <img src="[[+tv.portfolio-image]]" alt="[[+pagetitle]]"/>
    


    Questions:

    Am I supposed to put what I want the tvPrevix to be in &tvPrevix parameter, i.e.
    &tvPrefix=`tv`


    Am I supposed to actually name my TV with the prefix, or does getResource add that on? i.e. should I name my tv, tv.portfolio-image ?


    But aside from that... I’m not even getting broken code in my html, like

    <img src="" alt="">

    There’s nothing at all when I view source.
      • 22303 MODX Staff
      • 10,725 Posts
      The default tvPrefix property is set to the value:
      tv.

      Since you set it to blank, do not prefix your tv placeholders with that value.
        • 12941
        • 87 Posts
        OpenGeek,

        I tried that, but it’s still not displaying anything. Even if my TV wasn’t displaying right, I should still get some of the HTML from my template displaying, even if the images are broken, if getResources is working?
          • 12941
          • 87 Posts
          Also, if I were to put a prefix in, do I have to actually physically rename my resource to have the prefix in, or is it just to use in my templates?
            • 12941
            • 87 Posts
            OK, I think I found my problem ... the documents I was trying to display were not published. Duh.

            From what I can tell, you do need to add the tv. prefix to the placeholder and to your actual tv, and you should not put anything in the tvprefix parameter. Doesn’t quite make sense to me and this is not documented, but ah well. Hopefully this will help someone having the same issue!
              • 22303 MODX Staff
              • 10,725 Posts
              Quote from: ingero at Nov 22, 2010, 09:37 AM

              From what I can tell, you do need to add the tv. prefix to the placeholder and to your actual tv, and you should not put anything in the tvprefix parameter. Doesn’t quite make sense to me and this is not documented, but ah well. Hopefully this will help someone having the same issue!
              This is absolutely not true; you would never name a TemplateVariable tv.SomeField; the tv. is simply prefixed to the TemplateVariable name to identify and isolate the placeholders set from TemplareVariables within the getResources snippet. When you set the tvPrefix to blank you would not refer to the TemplateVariable with a tv. prefix. Very simple.
                • 12941
                • 87 Posts
                Jason,

                Oh, hm... well, it seems to be working that way. I will try renaming it and see if it still works.
                  • 12941
                  • 87 Posts
                  OK, so if I remove tv. from my template variable name, then it doesn’t work. But if I change my placeholder to [[+staff-photo]] then it works, without the prefix. If I change my call to: tvprefix=`tv` and use the placeholder [[+tv.staff-photo]] then it doesn’t work.
                    • 22303 MODX Staff
                    • 10,725 Posts
                    Quote from: ingero at Nov 22, 2010, 03:49 PM

                    OK, so if I remove tv. from my template variable name, then it doesn’t work. But if I change my placeholder to [[+staff-photo]] then it works, without the prefix. If I change my call to: tvprefix=`tv` and use the placeholder [[+tv.staff-photo]] then it doesn’t work.
                    Exactly; it would only work if you changed &tvPrefix=`tv.`
                      • 12941
                      • 87 Posts
                      But I did change tvprefix to tv, and it wasn’t working huh I can try again, but I’ve already tried it 3 times. Perhaps I just need to clear my cache ??