We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 7515
    • 10 Posts
    Unfortunately, removeChunk doesn’t seem to work with dynamic chunks, other than Jot (??).

    If my chunk looks like this:
    {{BlogHeader}}
    <h1>blog header!!</h1>


    and my call to Ditto includes &removeChunk=`BlogHeader`, it is stripped out fine.

    However if the chunk has template variables or snippet calls, it is not stripped out:
    <h1>blog header!!</h1>
    <h2>[*pagetitle*]</h2>


    Is there a solution for this?
      • 20413
      • 2,877 Posts
      Hmm...

      "If you have [*fields*] in your [+content+] make sure Ditto already has access to them in the form of [+field+]. If you need to add a field but not have it displayed use the &hiddenFields parameter."

      From http://modxcms.com/forums/index.php/topic,13533.0.html
        @hawproductions | http://mrhaw.com/

        Infograph: MODX Advanced Install in 7 steps:
        http://forums.modx.com/thread/96954/infograph-modx-advanced-install-in-7-steps

        Recap: Portland, OR (PDX) MODX CMS Meetup, Oct 6, 2015. US Bancorp Tower
        http://mrhaw.com/modx_portland_oregon_pdx_modx_cms_meetup_oct_2015_us_bancorp_tower
        • 16034
        • 107 Posts
        How about putting the jot-call in your template for the documents, then when Ditto fetches [*content*], there is no need to do "magic" to remove the jot-call.
          MODx snippet-glossary 101:
          Ditto = Content Lister -- Wayfinder == Menu Builder -- Jot = Comment Control
          • 2912
          • 315 Posts
          I’ve had the same issue with removeChunks. It’s as already stated due to the dynamic nature of chunk contents (ie [!Jot.....!]. When the chunk is dynamic it’s output is generated prior to chunk removal and therefore doesn’t match chunk removal procedure and remains in place.

          I’ve worked out a work around for myself:

          I have a page for an RSS feed with the following snippet call:
          [[Ditto? &extenders=`summary` &parents=`132,213` &format=`rss` &depth=`1` &display=`20` &sortBy=`createdon` &removeChunk=`GalleryDB,MovieComments` &trunc=`1` &truncAt=`{{MovieComments`]]
          

          I tried the <!-- splitter technique but it didn’t work. Make sure you don’t use the full chunk code {{..}} and it should see you through.

          Hope it helps.
            BBloke
            • 26422
            • 107 Posts
            I can’t seem to get this to work or figure out why. Sorry if this has been answered I just can’t get my mind around the issue. Here is my code. I’m just trying to get rid of the comments section on the page but show full content.

            [[Ditto? &dateFormat=`%B %d, %Y` &dateSource=`pub_date` &tpl=`ditto_blog` &removeChunk=`FormBlogComments` &extenders=`dateFilter` &parents=`83` &tagData=`MyTags` &tagdelimiter=` ` ]]

            Thanks for any help.
              Crawford Paul

              Bridgecourt Web Design - Proudly using ModX CMS
              Serving Welland, Niagara, Ontario, Canada and the world!
              http://www.bridgecourt.com
              • 2912
              • 315 Posts
              See my post above. I’ve got it working using truncate. Only way possible with dynamic chunks.
                BBloke
                • 7515
                • 10 Posts
                As stated, removing a comments chunk where the only dynamic piece is a call to the Jot snippet works. However calls to other snippets or template variables in the chunk do not allow it to be removed. I don’t know why Jot works. I have worked out a solution for myself that includes not needing to remove any chunks. (separate templates and display pages).

                Scottishbullet, if the only dynamic piece in your FormBlogComments is a call to jot, experiement with [[ ]] and [! !]. For me to get it to work, I had to use an uncached call to [!Ditto? ..!] and within the Comments Chunk an uncached call to [!Jot? ...!]
                  • 26422
                  • 107 Posts
                  Thanks for your help - I got it to work. I didn’t have the call to Jot uncached.
                    Crawford Paul

                    Bridgecourt Web Design - Proudly using ModX CMS
                    Serving Welland, Niagara, Ontario, Canada and the world!
                    http://www.bridgecourt.com