We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 21419
    • 84 Posts
    Working on my first Revolution site and I’m having a huge problem getting TVs to work. I have to assume I’m doing something very wrong as the non-TV fields are being processed correctly.

    I have an area on my home page that will rotate some text and images.
    I’ve created a document resource under "Home" called "Home Page Main Art Rotator" (id of 42).
    Within this directory, I create the documents that contain the information used in this area.

    In the Home content field, I put
    [[!getResources? &parents=`42` &tpl=`mainArtTpl` &processTVs=`1` &includeTVs=`1` includeContent=`1` ]] 


    The code for the Chunk used as the template for these elements is:
    <li>
    <a href="[[+tv.rotatorLink]]">
    <img class="switchimage" src="[[+tv.rotatorImage]]" />
    <h6>Photo by [[+rotatorCredit]]</h6>
    <div class="slideshow-overlay">
    <h3>[[+longtitle]]</h3>
    <h4>[[+description]]</h4>
    </div>
    </a>
    </li>
    


    rotatorLink is a URL TV
    rotatorImage is an Image TV

    All of the other data is showing up as expected. The TVs work perfectly well when creating the resources. I can select an image and enter the URL, but the output on the page is empty in those spaces. Like this:
    <li style="z-index: 99; display: none;">
    <a href="">
    <img src="" class="switchimage">
    <h6>Photo by </h6>
    <div class="slideshow-overlay">
    <h3>Headline Two</h3>
    <h4>This is the description</h4>
    <p></p>
    </div>
    </a>
    </li>
    


    I believe I’ve doing something fundamentally wrong since no TV data is being processed though they are in the DB.

    I am running Revolution 2.0.2, but this was happening in 2.0.0 as well.
      • 30025
      • 32 Posts
      timharris777 Reply #2, 16 years ago
      Try taking out &processTVs=’1’ from the snippet call. If that doesn’t work check the spelling of TVs. If you still have the same result then I ... BUMP
        • 21419
        • 84 Posts
        Thanks, Tim. I removed the processTV=`1` - didn’t work. I also renamed the TVs with underscores instead of camelback - no effect (didn’t really expect it to work, but I’m desperate to try anything). Also made the TVs accessible from the Template for the Home Page in addition to the documents Since the failure is so complete, I have to believe I am missing something very basic.
          • 21419
          • 84 Posts
          In trying to pinpoint the problem, I added the rotator_image tv directly to an area on the homepage and it is processing properly. So the problem is not in the TV itself, but in the implementation I’m using.

          I also moved the getResources call from the Content of Home Page to a chunk named "mainArtBuilder" and am calling the Chunk from the Home Page. My thinking was maybe the TinyMCE was corrupting the string by converting the & to &amp;. This change didn’t fix anything either.

          Would really appreciate some help here before I scrap it all and go back to Evo.
            • 22019
            • 390 Posts
            Try checking that the resources you want the TVs from on the homepage aren’t hidden from menus (or add showHidden=`1`). Incidentally, I *think* the includeContent=`1` is superfluous as it literally means the field ’content’. And as the previous poster said, you need includeTVs and not processTVs as the latter will try and output them using the output field in the TV, whereas the former returns a string.
              Writer > E-consultant > MODx developer || Salesforce || modx 2.x || PHP 5.2.13 || MySQL client 5.0.86
              • 21419
              • 84 Posts
              I thought the same thing about includeContent and removed that. I also added showHidden=`1` as you suggested. It now looks like this:
              [[!getResources? &parents=`42` &tpl=`mainArtTpl` &includeTVs=`1` &showHidden=`1`]]​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​


              Still doesn’t work.

              You can see the home page here:
              http://www.tsminsurance.com.php5-18.websitetestlink.com/
              The block I’m working on is the the first block with the changing text "Headline One", "Headline Two", etc.
              Everything else related to this is working properly. Also, in block "D" (second row, second div) you can see the use of the rotator_image TV pulling in the image (it’s just a big orange jpeg).

              The same TV is used in the Chunk used as the template for getResources, but it is still returning nothing. I’ve also tried using uncached TVs in the chunk. [[!+tv.rotator_image]]... no effect.
                • 21419
                • 84 Posts
                I have it working now. It appears the problem was an unused TV included in the template Chunk.

                I’d created 3 TVs for the resources - rotatorLink (URL), rotatorImage (image), and rotatorCredit (text).

                My original Chunk looked like this...

                <li>
                <a href="[[+tv.rotatorLink]]">
                <img class="switchimage" src="[[+tv.rotatorImage]]" />
                <h6>Photo by [[+rotatorCredit]]</h6>
                <div class="slideshow-overlay">
                <h3>[[+longtitle]]</h3>
                <h4>[[+description]]</h4>
                </div>
                </a>
                </li>
                


                In all of my attempts to get this working, I’d completely ignored "rotatorCredit" as it was an empty field and was focused on why the image and URL were not processing. It turns out it was because the "rotatorCredit" TV was improperly formatted in the Chunk.

                [[+rotatorCredit]]
                instead of
                [[+tv.rotatorCredit]]


                <li>
                <a href="[[+tv.rotatorLink]]">
                <img class="switchimage" src="[[+tv.rotator_image]]" />
                <h6>Photo by [[+tv.rotatorCredit]]</h6>
                <div class="slideshow-overlay">
                <h3>[[+longtitle]]</h3>
                <h4>[[+description]]</h4>
                <p>[[+introtext]]</p>
                </div>
                </a>
                </li>​
                


                Instead of being ignored, the single instance of an improperly formatted TV disabled the other TVs completely.

                Perhaps somebody can explain this to me when they get the chance.

                Thanks for all of the help. I feel so much better now that I can actually move forward again!