We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 18397
    • 3,250 Posts
    commentsChunk is removeChunk in Ditto 1.1b2
      • 16885
      • 255 Posts
      Quote from: Mark at Dec 03, 2006, 04:04 PM

      commentsChunk is removeChunk in Ditto 1.1b2
      Edit again; it did solve it once, but I’m unable to reproduce it now. I’m using the following call;
      [[Ditto? &startID=`2` &summarize=`3` &trunc=`0` &displayArchive=`0` &hideFolders=`0` &mode=`development` &dateFormat=`%A%e %B %G` &tpl=`NewsPost` &removeChunk=`JotBlogComments` &tagData=`tvblogTags` &debug=`0`]] 

      And I’m calling the chunk in the posts as {{JotBlogComments}} (which seems logical to me), but still it doesn’t filter it.

      Edit; changed back to the latest ’stable’, hopefully you’ll find time to fix this later on.
        • 21056
        • 327 Posts
        I’ve been using the RSS output format, and come across a couple of little issues

        1) In rss.format.inc.php, each <item> has an output of [+tags+]. When rendered as XML, it just shows ’None’, but this is not within any XML tags, which causes the feed to fail validation

        2) It is outputting <language>english</language> - it should be outputting <language>en</language>, or again, the feed fails validation. The logic around line 11 seems slightly flawed - changing it to
        $rss_placeholders['[+rss_lang+]'] = $_lang['abbr_lang'];

        gives the correct output, and makes the RSS validate. This probably isn’t ideal, but was the easiest way I could get it to work correctly.

        3) It would be great to be able to specify an XSL page, so the feed can look nice. It was fairly easy to add in:

        After the line:
        $rss_placeholders['[+rss_charset+]'] = isset($charset) ? $charset : $modx->config['etomite_charset'];
        add
        $rss_placeholders['[+rss_xsl+]'] = isset($xsl) ? $modx->config['site_url']."[~$xsl~]" : '';


        And after the line
        <?xml version="1.0" encoding="[+rss_charset+]" ?>
        add
        <?xml-stylesheet type="text/xsl" href="[+rss_xsl+]"?>


        You can then add another parameter to your Ditto call with the doc ID for the XSL:
        &xsl=`87`
        where obviously the document uses a blank template and text/xml headers.
          Author: ManagerManager plugin - customise your ModX manager interface

          Rckt - web development, Sheffield, UK
          • 1511
          • 144 Posts
          I have multiple ditto calls on one page. First is a call for Reflect to use, the second is a generic one, that comes later, to show the N most recent posts.
          But once I click on an archive month/year of the Reflect output, the second call gets filtered too!

          Maybe you should add a dontFilter parameter, so different calls won’t be filtered.

          $dontFilterDate= isset($dontFilterDate) ? ($dontFilterDate) : false;
          


          and later

          // ---------------------------------------------------
          // Date Filter Parameters
          // ---------------------------------------------------
          
          if ($dontFilterDate != true) {
          if (!empty($_GET['year'.$dittoDisplayID])) {
          	if (!empty($_GET['month'.$dittoDisplayID])) {
          		$month = $_GET['month'.$dittoDisplayID];
          		$year = $_GET['year'.$dittoDisplayID];
          		$dateFilter = "$dateSource,$month $year,date";
          		$modx->setPlaceholder("month$dittoDisplayID",$_GET['month'.$dittoDisplayID]);
          		$modx->setPlaceholder("year$dittoDisplayID",$_GET['year'.$dittoDisplayID]);
          	} else {
          		$year = $_GET['year'.$dittoDisplayID];
          		$dateFilter = "$dateSource,$year,date";
          		$modx->setPlaceholder("year$dittoDisplayID",$_GET['year'.$dittoDisplayID]);		
          	}
          	$filter= ($filter !==false) ? $filter."|$dateFilter": "$dateFilter";
          }
          }
          



          TIA,
          Andraz
            • 18397
            • 3,250 Posts
            The problem is that in Beta 2 the placeholder that is set for Reflect does not have the Ditto ID as the suffix. So your Reflect call is getting the data from the filtered one.
              • 1511
              • 144 Posts
              Quote from: Mark at Dec 12, 2006, 09:57 PM

              The problem is that in Beta 2 the placeholder that is set for Reflect does not have the Ditto ID as the suffix. So your Reflect call is getting the data from the filtered one.

              The Reflect call does it allright, it’s the other call that gets filtered the same as Reflect!
                • 1511
                • 144 Posts
                Another idea. My NewsPublisher attaches two chunks calls to every post: a {{postHeader}} and a {{postFooter}}, one on top (headerTpl) and one on bottom (footerTpl).

                I can filter the top one out with removeChunk parameter, but if the post is really short, the postFooter shows in various listings, RSS feeds and so on.

                It would be great if you could pass a comma delimtied list of chunk names to the removeChunk parameter and have Ditto remove them all instead of just one!
                  • 12652
                  • 228 Posts
                  Mark,

                  the tag-linking placeholder is great! One thing that I’m looking for, and maybe it is there and I just haven’t found it yet... a way to output all of the possible tags (using a free tagging system) with links. For instance, say my Ditto call summarizes 3 articles, followed by the Reflect call, which then breaks out all articles by year, month, and then by article....

                  sidebar.... should Reflect be including the articles that are already in the Ditto summary? Anyway not to?

                  ...and with the tagging, I can click on the Ditto article, or a tag to bring up a summary of matching tagged articles. But say none of the summarized articles have been tagged "This" or "That" and I’d like to see a listing of those articles.

                  Anyway to have a list of all used tags, maybe between the Ditto call and the Reflect call so I could have....

                  This That Other Something

                  Clear as mud?
                    | Identity Developments delivers SEO focused web design and web presence services
                    - it&#39;s not about websites, it&#39;s about your identity. |
                    • 12652
                    • 228 Posts
                    Okay, and a new question/issue....

                    I had the following code, and even with a force pagination links, couldn’t get anything to appear:
                    [!Ditto? &startID=`101` &depth=`5` &summarize=`3` &tpl=`DittoArticleSummaryTpl` &paginate=`1` &tagData=`tvTags` &tagDelimiter=`,` &trunc=`1` &truncLen=`300` &truncOffset=`30`!]
                    <div class="pagination">[+previous+] [+pages+] [+next+]</div>
                    


                    After removing everything, adding and removing different elements with no change, I happened to try the call uncached, and it worked.

                    On another site though, I have the uncached call and pagination works no problem. In fact, I just tried changing the call on that site and it seems to work either way. The only thing different in that one is using filter instead of tags:
                    [!Ditto? &tpl=`ProductSummary` &tplAltRows=`ProductSummaryAlt` &depth=`5` &summarize=`11` &filter=`tvProductType,Watch` &sortBy=`tvProductOrder` &sortDir=`ASC` &paginate=`1`!]
                    
                    <div class="pagination">[+previous+] [+pages+] [+next+]</div>


                    huh
                      | Identity Developments delivers SEO focused web design and web presence services
                      - it&#39;s not about websites, it&#39;s about your identity. |
                      • 18397
                      • 3,250 Posts
                      "sidebar.... should Reflect be including the articles that are already in the Ditto summary? Anyway not to?"

                      Yes, just use &save=1

                      "...and with the tagging, I can click on the Ditto article, or a tag to bring up a summary of matching tagged articles. But say none of the summarized articles have been tagged "This" or "That" and I’d like to see a listing of those articles."

                      You can use a combination of the tagsLanding parameter and a second call to accomplish this. Create a new document and put the same Ditto call as on your blog page there except have &summarize=`all`. Then on your blog page set &tagsLanding=`that new documents ID`.

                      "to have a list of all used tags, maybe between the Ditto call and the Reflect call so I could have"

                      Ditto does not have the capability to say "here are all the tags of all the documents I can see". It only keeps these values as it parses each item in order to keep memory usage low. You should be able to code a simple snippet that simply gets all of the values of a tv, and then runs the function within Ditto that generates the tag links.

                      As for your cache issue what version of MODx are you using? Ditto 1.x has only been tested extensively on MODx 0.9.2.1. (Don’t worry, the next release will be 100% 0.9.5 tested)