We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 34162
    • 1 Posts
    I would like to know how snippets, tvs and chunks play together in modx.
    Up to now I think I figured out the following:
    1. You can pass parameters for a snippet-call using a chunk in the template-line invoking the snippet
    2. You cannot pass parameters for a snippet-call using the value of a tv-variable

    So: in which sequence are the different "content-types" (just to give it a name) computed?

    My guess: TVs come in after rendering - that’s why they could be so nicely integrated in "post-editing" (I mean QuickEdit), the drawback, however, is that you cannot "quickedit" the params of a snippet.

    Varying a well-known truism: Asking the developer can save hours of reading source-code grin
      • 11975
      • 2,542 Posts
      I’m french so excuse me  If I misunderstood your questions.

      But For the point 2/ I disagree
      You can pass TV value for a snippet call in your template.

      You can edit Your TV in front End using FCKeditor, If you wish to see a specific button in your front end call your TV [*#myTV*] in your html code.

      :-)
        Made with MODx : [url=http://www.copadel.com]copadel, fruits et l
        • 34162
        • 1 Posts
        Hmm, I guess that’s not exactly what I meant:
        Maybe that I can call a snippet using a TV (if my assumptions were correct, this would not be possible - in so far you’re right!), but I have experienced that I cannot change the value of an already called snippet using a TV.
        My example: I called the Dropmenu-Snippet (in the template code, providing a TV-variable) and wanted to set its starting document (startdoc) individually for the pages, but the value passed to the tv (a document-id) had no effect. The TV value itself was stored in the page-record, but the behaviour of the snippet (the appearance of the menu) wasn’t affected though.
          • 11975
          • 2,542 Posts
          After having tested , you’re right !
          If you set by hand the startDoc and call Twice( with two different values for startDoc) in the same template DropMenu, you obtain the expected result => two different menus

          If you call a TV to set one of the startDoc, this value is overwritten by the first call.
          I’ve tried with phMode=true and [+placeHolder+] but the result is the same.

          :-)
            Made with MODx : [url=http://www.copadel.com]copadel, fruits et l
            • 6726
            • 7,075 Posts
            I can’t say much right now but let’s say new things will come up in the future that will allow to do exactly what you need grin
              .: COO - Commerce Guys - Community Driven Innovation :.


              MODx est l'outil id