We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 4295
    • 98 Posts
    Mark,

    I must not be understanding the new keywords parameter. I thought that using &keywords=`1` would add a join to grab the keywords of the searched documents. And that you’d be able to filter based on those keywords. I’m trying to return results whose keywords match the pagetitle of the page on which the Ditto call is made -- but no luck. Can you briefly explain this parameter when you have time? Thanks.
      • 18397
      • 3,250 Posts
      keywords works with &tagData=`keywords` &tagDelimiter=`,` &keywords=`1`
        • 4295
        • 98 Posts
        Quote from: Mark at Nov 16, 2006, 07:52 PM

        keywords works with &tagData=`keywords` &tagDelimiter=`,` &keywords=`1`
        Yeah, I had tried that but no go, at least not how I’m using it. I’m sure I’m making some basic mistake -- would you mind looking at the Ditto call below and letting me know why this wouldn’t return only results that have a keyword that matches the pagetitle of the Ditto call page? Thanks, much appreciated, as I’m at a deadend.

        [!Ditto? &tpl=`SomeTemplate` &startID=`xx` &idType=`parents` &depth=`1` &summarize=`20` &paginate=`1` &keywords=`1` &tagData=`keywords` &tagDelimiter=`,` &tags=`[*pagetitle*]` &tagMode=`onlyTags` &emptyText=`SomeText.` !]
          • 1511
          • 144 Posts
          I have a TV (checkbox, delimited list) containing categories.

          Has anybody got a working sample of:

          - tagging the article in front-end (ok, I’m using NewsPublisherTagging snippet from uglydog)

          Is this compatible with Ditto?

          - showing tags with every article on summary page

          Right now Ditto 1.1b2 shows: "None", even if the categories are checked.

          - showing tags with the article displayed (content +chunk UserComments or sth.)

          I’d need a snippet returning the tags-list for current article.

          - tags that are clickable and show articles containing that tag


          I’d appreciate your help, since this is the last thing bugging me prior to publish the whole web site made with MODx.
          Snippet calls and/or templates would be useful for better insight, since the documentation is on its way.

          Thanks!
            • 16429
            • 254 Posts
            Mark, I’ve found a bug in the parseSeedIDs function which stops the use of &documents param.
            All the info (and fix that works for me) in this post.
              kudo
              www.kudolink.com - webdesign (surprised?)

              [img]http://www.kudolink.com/kudolinkcom.png[/img] [sup]proudly uses[/sup] [img]http://www.kudolink.com/modx.png[/img]
              • 19645
              • 23 Posts
              I now have succesfully for my blog with tags, the way I like it with Ditto 1.1beta2. Initially I tried to achieve this with Ditto 1.01 + Categorytags. This didn’t work for me, so I posted my problem in the ditto 1.01 topic and Mark pointed me to Ditto1.1beta2. I have posted the way I got it working in the ditto 1.01 topic: http://modxcms.com/forums/index.php/topic,4951.msg64151.html#msg64151

              In order to have this fully operational with a textbox to add tags to the template variable, I changed the categoryOptions template variable (contains blogging tags) to text and made some changes to the FormBlog chunk and the NewsPublishertagging snippet.

              In FormBlog I added:
              <label for="tags">Tags:<input name="tags" id="tags" type="text" size="40" value="[*categoryOptions*]" /></label><br>


              In Newspublishertagging I replaced:
              //add tag data
                          if($tags_tvcontent){
                          	$rs = $modx->dbQuery("SELECT id FROM ".$modx->getFullTableName('site_tmplvars')." WHERE name='".substr($tvtags, 2)."' LIMIT 1;");
              	            if($row = $modx->fetchRow($rs, 'assoc')){
              		            $tmplflds = array(
              		            	'tmplvarid' => $row['id'],
              		            	'contentid' => $lastInsertId,
              		            	'value' => mysql_escape_string($tags_tvcontent)
              		            );
              		            $modx->db->insert($tmplflds,$modx->getFullTableName('site_tmplvar_contentvalues'));
              		        }
              	        }
              

              with
               //add tag data
                          if($tags_tvcontent){
                          	$rs = $modx->dbQuery("SELECT id FROM ".$modx->getFullTableName('site_tmplvars')." WHERE name='".substr($tvtags, 2)."' LIMIT 1;");
              	            if($row = $modx->fetchRow($rs, 'assoc')){
              		            $tmplflds = array(
              		            	'tmplvarid' => $row['id'],
              		            	'contentid' => $lastInsertId,
              		            	'value' => mysql_escape_string($modx->stripTags($_POST['tags']))
              		            );
              		            $modx->db->insert($tmplflds,$modx->getFullTableName('site_tmplvar_contentvalues'));
              		        }
              	        }
              



                • 23050
                • 1,842 Posts
                Hi Mark,

                Let’s say I have 14 documents to display. I use paginate=`1` and &summarize=`7` so that I display them on 2 pages.
                Now, I want to sort them by id. Look what it outputs :

                Page 1 : (numbers are id)
                91, 84, 83, 82, 80, 78, 77

                Page 2 :
                97, 94, 90, 89, 88, 87, 86

                In fact on each page, it sorts well but if you look globally, sorting is not good. I would have liked to get

                Page 1 :
                97, 94, 91, 90, 89, 88, 87

                Page 2 :
                86, 84, 83, 82, 80, 78, 77

                Is that the problem someone mentionned here ? Or a bug in beta 2 ?

                Thanks for your help wink
                  • 11975
                  • 2,542 Posts
                  Hi Mark,

                  It seems that there is an error in reflect code around Line 131:
                  
                  			$post_category_url = $ditto->functions->buildURL("year=".$dateArray['year'],$archiveDocumentID,$id);
                  		$post_subcategory = $dateArray['month'];
                  			$post_subcategory_url = $ditto->functions->buildURL("month=".$dateArray['month']."&year=".$dateArray['year'],$archiveDocumentID,$id);
                  


                  buildUrl is no more in functions.class.inc.php but in ditto.class.inc.php

                  
                  			$post_category_url = $ditto->buildURL("year=".$dateArray['year'],$archiveDocumentID,$id);
                  		$post_subcategory = $dateArray['month'];
                  			$post_subcategory_url = $ditto->buildURL("month=".$dateArray['month']."&year=".$dateArray['year'],$archiveDocumentID,$id);
                  
                    Made with MODx : [url=http://www.copadel.com]copadel, fruits et l
                    • 23050
                    • 1,842 Posts
                    Hi Mark,

                    I use [*id*] as &startID in the Ditto call.
                    Then, I call [[Reflect?]] but it outputs Bad Ditto object

                    If I use a number, let’s say 49 in my website, it outputs good archives.

                    It seems that there is a bug with [*id*]. I asked Heliotrope to test and he got the same Bad Ditto object using [*id*].

                    PS : I run 0.9.5 RC 2
                      • 28042 ☆ A M B ☆
                      • 24,524 Posts
                      Doesn’t Ditto use the current document by default? Then you don’t need to specify a startID at all.
                        Studying MODX in the desert - http://sottwell.com
                        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                        Join the Slack Community - http://modx.org