We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 34162
    • 1 Posts
    Let say if I have a TV call "HelloMarquee" and a snippet call "HelloSnippet" and a document call "Hello" so in the document I sould put in [[HelloSnippet]] but how do I tie the "HelloMarquee" with "HelloSnippet"

    Is it possible to do that?

    Thanks
      • 22303 MODX Staff
      • 10,725 Posts
      Quote from: chanh at Feb 18, 2006, 02:46 PM

      Let say if I have a TV call "HelloMarquee" and a snippet call "HelloSnippet" and a document call "Hello" so in the document I sould put in [[HelloSnippet]] but how do I tie the "HelloMarquee" with "HelloSnippet"

      Is it possible to do that?

      Thanks

      Just return the the TV tag somewhere in the snippet output.

      ...
      $out= "[*HelloMarquee*]";
      ...
      return $out;
      
        • 34162
        • 1 Posts
        So the TV is return a stream of text and can be assign into a variable in a snippet and therefore snippet can use it just like any variables.

        Very clever!

        Thanks
          • 22303 MODX Staff
          • 10,725 Posts
          Quote from: chanh at Feb 18, 2006, 10:02 PM

          So the TV is return a stream of text and can be assign into a variable in a snippet and therefore snippet can use it just like any variables.

          Actually, the snippet simply outputs the TV tag, and another trip through the parser then processes the TV tag. Be careful though, if you nest this too deeply within other resources, the parser only runs through a certain number of times, so deeply nested tag may not actually get processed.