We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 20549
    • 29 Posts
    This is driving me nuts...
    (Revo 2.2.6 in the maddening modx cloud...)

    I am simply trying to use a TV to insert various chunks into each resource.

    Also want to send a special shout out to the uber-geek that wrote this page:
    http://rtfm.modx.com/display/revolution20/CHUNK+Binding
    Thanks for making me feel dumb, because I have no idea how to use that information in real life... can anyone else understand that page?

    I digress...
    In my TV, my input option is List Box.
    My input option values are this:
    [[$resp_slider]]||[[$page_h2]]

    Output is default.

    simply expect my TV to call one of the two chunks. I get no results when I select either of the two chunks. If I put either chunk in as a default value, my TV publishes it fine.

    Why, o why, does the TV NOT publish my chunk selection when it seems to publish the default?
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      @CHUNK does precisely what the documentation says it will do. @CHUNK my_chunk will simply insert the content of your chunk named my_chunk.

      As for why your TV isn't displaying the selected chunk's value, I have no idea. That same kind of list box works fine when I try it.



        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
        • 20549
        • 29 Posts
        @sottwell -
        I apologize for being testy about the @CHUNK documentation. My frustration with that documentation has less to do with the way it is written than with the problem I am having.

        As you pointed out, such a simple TV works fine everywhere else I use it. Unfortunately, in this particular host/website/set up, it does not. the @CHUNK use works no differently than when I use [[$my_chunk]].

        Very frustrating to waste HOURS trying to find the source of a problem that just shouldn't exist. Not helping matters is that this issue is happening on another of my attempts to use the modxcloud for development. I can't fathom why the modxcloud might be contributing to my issue, but as you say, the simple TV coding works everywhere else but on this setup!

        What is most confusing/frustrating about my issue is that either of my two chunks will publish if I set one or the other as a default. When default is left blank, neither will publish when selected in the TV tab of the document I am editing.

        For edification, here is my code. Anyone see any reason why it wouldn't work?
        My TV


        In the template


        Setting it in the doc


        Going the last mile, perhaps there is a chunk or TV handling files in my install that are not right. Can anyone direct me to where I might replace or update those files? Seems that if I can't fix this simple issue, the modxcloud will again be blamed for having to move back to other hosting. I'm pretty excited about the modxcloud tools, but keep hitting the wall with issues.
          • 3749
          • 24,544 Posts
          Try this:

          resp_slider||page_h2



          [[!$[[*page_heading]]]]


          I've updated the @CHUNK page. See if it makes more sense to you. @ bindings are easy to understand once you understand them, but it's not always easy to get to that point. wink

          I don't think @CHUNK would work for you because it's meant to bind a single chunk to a single TV. I don't think it can be used in a TV that selects between multiple chunks. I could be wrong.
            Did I help you? Buy me a beer
            Get my Book: MODX:The Official Guide
            MODX info for everyone: http://bobsguides.com/modx.html
            My MODX Extras
            Bob's Guides is now hosted at A2 MODX Hosting
            • 3749
            • 24,544 Posts
            PS: @ bindings are explained at some length in my book: http://amzn.to/Qfsl1Z wink
              Did I help you? Buy me a beer
              Get my Book: MODX:The Official Guide
              MODX info for everyone: http://bobsguides.com/modx.html
              My MODX Extras
              Bob's Guides is now hosted at A2 MODX Hosting
              • 20549
              • 29 Posts
              Quote from: BobRay at Mar 18, 2013, 02:35 PM
              Try this:

              resp_slider||page_h2



              [[!$[[*page_heading]]]]

              Thank you for the effort BobRay. Unfortunately, I get the same result.

              Actually, I'm starting to think this odd behavior might be related to a modification we created in the core/model/modx/modrequest file. However, that wouldn't explain why the Default Field field publishes but the Input Option Values will not!?! Might have to build a placeholder instead.
                • 3749
                • 24,544 Posts
                I would do it with a snippet:

                Make sure these are the names of the actual chunks:
                resp_slider||page_h2


                [[!GetHeading]]


                <?php
                /* GetHeading snippet */
                $tvValue = $modx->resource->getTVValue('page_heading')
                $tvValue = trim($tvValue);
                return $modx->getChunk($tvValue);
                  Did I help you? Buy me a beer
                  Get my Book: MODX:The Official Guide
                  MODX info for everyone: http://bobsguides.com/modx.html
                  My MODX Extras
                  Bob's Guides is now hosted at A2 MODX Hosting