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

    I am looking for a simple way to change 2 parts of a template with one selection, say in a Listbox (Single-Select) TV. Is this achieved with a placeholder?

    Rough Template with 2 chunks whose contents would be controlled by the selection within a TV Listbox:
    html
      <head start>
        [b][[someScriptBit]][/b]
    </head end>
      <body start>
        [b][[changeingContent]][/b]
    </body end>
    /html


    The way I would like things to work is that a selection is made in the Listbox, this would change the Chunks that are used for [[someScriptBit]] and [[changeingContent]].

    Any suggestions or ideas would be helpful.

    I hope that the above makes sense. If not, ask me.

    Thank's in advance.

    [ed. note: glynszasz last edited this post 12 years ago.]
      Glyn Szasz
      Sydney, Australia

      Happy to help (when can) and happy to learn

      If you are a Sydney based MODX developer would love to hear from you. Please contact me.
      • 19369
      • 1,098 Posts
      You could try to name your chunks in this way: chunk_head_1,chunk_head_2,chunk_head_3 and chunk_body_1,chunk_body_2,chunk_body_3.

      Then in the listBoxTv, you put this: first==1||second==2||third==3


      And then use this code:
      <head>
          [[$chunk_head_[[*listBoxTv]]]]
      </head>
      <body>
          [[$chunk_body_[[*listBoxTv]]]]
      </body>
      
      [ed. note: microcipcip last edited this post 12 years ago.]
        • 37523
        • 141 Posts
        Thanks microipcip for such an elegantly simple solution. Makes so much sense.
          Glyn Szasz
          Sydney, Australia

          Happy to help (when can) and happy to learn

          If you are a Sydney based MODX developer would love to hear from you. Please contact me.