We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 28107
    • 230 Posts
    You knw that if youre working with many chunks you'll come to that point
    when you can't remember, which chunk is called at this position in that template.

    I think of placing a snippet call in each chunk, that generates something like that:
    <!-- id:123 -- chunk: 45 -->
    


    Or should I use a plugin that listens onChunkFormSave?

    The id is easy : [[*id]]
    But how do I get the chunk's id ?


      CONIN Werbeagentur . Köln
      http://www.conin.de
      • 38850
      • 110 Posts
      Couldn't you just use normal documentation techniques? Use a docblock-style comment in snippets, and then in the chunks, use a snippet comment which is like [[- this is a comment]].

      If you use html comments like <!-- then they will be visible in your source. A MODX comment tag won't be visible.

      Maybe I'm not understanding where you want the comments to show up or what they are used for!
        • 28107
        • 230 Posts
        I know - it would be in the source code. And thats where you sometimes look first, what is delivered.
        So a comment with some numbers would help identifying used chunks.

        If its done with a plugin, I could after debugging yust disabling this plugin ..

        Furthermore, you mybe can put some runtime data into the output to check, how much time a chunk uses...

          CONIN Werbeagentur . Köln
          http://www.conin.de
          • 38850
          • 110 Posts
          It's an interesting idea.

          At the end of the day though, all chunks and snippets are meant to output something. So it seems you may have to call a special debug snippet from EVERY other snippet and chunk, and then the debug snippet would collect all the details of each thingy and echo the final tally.

          There is no system event that connects to something like "onChunkRender" or whatever so that you could capture them, so a plugin is out. It would have to either be done via the chunks/snippets themselves, or by calling a single master debug snippet to collect the pieces.

          In your chunks you could have a call like

          [[DebugInfo? cid=`4`]]


          Then the snippet would collect all the comments and stick them in the final output or something.

          Only problem is the comments would all appear together.
          If you want the comments to appear exactly in code where the chunk's output is rendered, then I would guess it has to be the chunk itself that does the outputting.

          Anyway, good luck finding a solution!
            • 13428 ☆ A M B ☆
            • 1,031 Posts
              • 28107
              • 230 Posts
              Quote from: Jako at Mar 06, 2015, 02:41 PM
              Try http://modx.com/extras/package/bloodline

              perfect - many thanks
                CONIN Werbeagentur . Köln
                http://www.conin.de