We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 37032
    • 64 Posts
    Hello,

    I'm trying to pass multiple values from the chunk-call to the placeholder inside but can't get it to work. Can you see what's missing?

    [[$myChunk? &myProperty=`value1,value2`]]


    Placeholder is placed within "myChunk"
    [[$[[+myProperty]]]]


    TIA
      • 3749
      • 24,544 Posts
      Each property can only have a single value (otherwise, how would MODX know which value to use to replace the placeholder tag).

      If you can give more details about exactly what you're trying to do and why, we might be able to suggest another way to do it.
        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
        • 37032
        • 64 Posts
        Quote from: BobRay at Oct 19, 2011, 02:17 PM
        Each property can only have a single value (otherwise, how would MODX know which value to use to replace the placeholder tag).

        If you can give more details about exactly what you're trying to do and why, we might be able to suggest another way to do it.

        I'm trying to tell the
        [[$header]]
        chunk which template specific javascripts to include.

        And.. I'm not a back-end developer so understandable suggestions/explanations are welcome wink
        [ed. note: tomahl last edited this post 15 years ago.]
          • 3749
          • 24,544 Posts
          There are lots of ways to go on this. If each template has a constant set of JS includes, you can just put the lines to include the JS in the template itself. That's certainly the simplest solution.

          You could also put different sets of JS include lines in different chunks and make the selection by which chunk you insert.

          If you need to select JS includes on a page-by-page basis, with different sets used for the same template on different pages, it gets more complicated, but let's not go there unless you really need that capability.
            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
            • 37032
            • 64 Posts
            This works:

            [[$scriptBlock? &scriptCustom=`[[$scriptCustom-1]][[$scriptCustom-2]]`]]


            Note! To get the above to work I had to change the placeholder inside my script-block chunk from
            [[$[[+placeholder]]]]
            to
            [[+placeholder]]
            . [ed. note: tomahl last edited this post 15 years ago.]