We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 7349
    • 40 Posts
    Hai Everybody,
    I made a website with 3 rows, navigation, tekst and sponsor logos.
    I made 2 chunks with a clickable image, then I made a TV with Check box and:
    Eerdmans==@CHUNK sp-eerdmans||Zuiderbaan==@CHUNK sp-zuiderbaan

    Now I have a possibility to checkout wich sponsor I like on witch page, but if a check one it works but if i check two i don’t see anything.
    I think I am missing something or I am doing something wrong.
    Can anybody help me on this?
    Thanks! Diederick
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Eerdmans=={{sp-eerdmans}}||Zuiderbaan=={{sp-zuiderbaan}}
        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
        • 7349
        • 40 Posts
        Thanks again Susan!
        It works now but then the next question when do I use the @CHUNK thing?
        Diederick
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          As far as I have ever used it, never. All it does it grab the content of the chunk specified, and just putting the chunk tags in will have the same effect.

          Actually it does behave a bit differently. @CHUNK directly gets the content of the chunk from the database, while using the chunk tags just lets MODx get the chunk when it sees the tags in the TV’s output.

          There might be conditions where the chunk tags won’t be processed by MODx, but it would be under very unusual circumstances. If your resource is getting passed through the parser more than 10 times and the chunk tags were only output by the TV in the 10th and last pass, then I suspect you’d have bigger design issues with the resource than that.

          The parser will process the resource as long as the latest pass produced output different than the previous pass, or until it’s gone through 10 times. This is the default set in the main index.php file, line 118 -
          $modx->maxParserPasses = 10; // max number of parser recursive loops or passes

          So even if nothing else happens, the TV’s output of the chunk tags will cause another pass, where the chunk tags will get processed. So at most using @CHUNK will save one pass through the parser, and chances are the TV’s output wasn’t the only difference in the previous pass anyway.

          Another use for @CHUNK might be if the chunk is being used as a parameter list for a snippet, and the TV is used to make a choice of chunks on a per-resource basis. In that case, using a TV in the parameter list might cause an issue if the TV’s output into the parameter list were just chunk tags rather than the contents of the chunk.
            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