We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 33114
    • 518 Posts
    Quote from: Mark at Jan 05, 2007, 02:19 AM

    I think it might be using natural order sorting. I will check and if possible make it so that you can swap between text and number sorting.

    thanks Mark!

    One more thing found - when using [+tags+] to generate tag links and when the tags are cyrillic, for example, the page does not validate cause its violates RFC1738 (non alphanumerical chars in URI should be encoded %HEX)... I guess u could use urlencode or something to form valid URIs.

    and... sorry for bugging, what would u Mark recommend to form those nice tag links on non-ditto pages. Is there a widget or something for tag TVs?

    thanks a lot for ur great work!
      http://modx.ru - российская поддержка MODx
      http://newscup.ru - экспериментальный проект
      http://yentsun.com - персональный сайт
      • 18397
      • 3,250 Posts
      Scotty D wrote a great snippet that does just that.
        • 33114
        • 518 Posts
        Somehow &tplAltRows is not working in my case
        [!Ditto? &startID=`23` &tpl=`photo_album` &tplAltRows=`photo_alt` &tagData=`tvtags` &tagDelimiter=`,`  &summarize=`4` &dateFormat=`%d.%m.%Y` &paginate=`0` &sortBy=`createdon` &sortDir=`DESC`!]
        - I got 2 rows for now and both of them got ’photo_album’ template. Maybe 2 is not enough for tplAltRows to work?

        firstRow and lastRow work ok. strange.
          http://modx.ru - российская поддержка MODx
          http://newscup.ru - экспериментальный проект
          http://yentsun.com - персональный сайт
          • 18397
          • 3,250 Posts
          Fixed in dev code.
            • 33114
            • 518 Posts
            Sorry Mark...did a google search over the forum - haven’t find where the dev code is. I guess I saw that somewhere...but now can’t find it/

            Thank u again very much for ur work
              http://modx.ru - российская поддержка MODx
              http://newscup.ru - экспериментальный проект
              http://yentsun.com - персональный сайт
              • 18397
              • 3,250 Posts
              1. A google search will not see the private team development forums
              2. Here is the link: http://modxcms.com/forums/index.php/topic,10673.30.html
                • 5074
                • 5 Posts
                Thanks nice snippet !

                Have you noticed this problem already ?
                : When tagging, pagenation doesn’t work properly.

                My template looks like this:

                [[Ditto? &tpl=`DittoTemplate` &summarize=`6` &archiveDateType=`pub_date` &sortBy=`pub_date` &dateFormat=`%Y-%m-%d %H:%M` &truncText=`Read More...` &paginate=`1` &paginateAlwaysShowLinks=`1`&tagData=`tvtags` &tagDelimiter=`,` &tagMode=`onlyTags`]]
                <div class="pagenate">
                [+previous+] | [+pages+] | [+next+]
                </div>
                


                and [+next+] turns links this:

                (Current) <a href="url?start=6">next</a>
                (Right)  <a href="url?start=6&tags=tags">next</a>


                I changed debug.class.inc.php paginate function,

                (Current)
                $next = $start + $summarize;
                $query = "";
                


                (Changed)
                $next = $start + $summarize;
                $query = "";
                $tagUrl = "&tags=".$this->tags;
                


                (Current)
                $nextlink = "<a href='".$this->buildURL("start=$next")."'>" . $tplNext . "</a>";
                $previous = $start - $summarize;
                $previouslink = "<a href='".$this->buildURL("start=$previous")."'>" . $tplPrevious . "</a>";
                


                (Changed)
                $nextlink = "<a href='".$this->buildURL("start=$next").$tagUrl."'>" . $tplNext . "</a>";
                $previous = $start - $summarize;
                $previouslink = "<a href='".$this->buildURL("start=$previous").$tagUrl."'>" . $tplPrevious . "</a>";
                


                (Current)
                $pages .= "<a class=\"ditto_page\" href='".$this->buildURL("start=$inc")."'>$display</a>";
                


                (Changed)
                $pages .= "<a class=\"ditto_page\" href='".$this->buildURL("start=$inc").$tagUrl."'>$display</a>";
                


                I’ll be glad if this info could help you.
                  • 18397
                  • 3,250 Posts
                  1. This issue has been addressed in a forthcoming update [In internal team testing now]. There was a typo in the buildURL function that kept $_GET persistance from working.

                  Here is a copy of the buildURL function from that release backported to the Ditto 1.1 Beta 2 codebase:

                  function buildURL($args,$id=false) {
                  	global $modx, $dittoID;
                  	if ($this->urlString == false) {
                  		$query = "";
                  		foreach ($_GET as $param=>$value) {
                  			if ($param != "id" && $param != "q" && $param != "start".$dittoID && $param != "tags".$dittoID) {
                  				$query .= "&".$param.'='.$value;
                  			}
                  		}
                  		
                  		$this->urlString = $query;
                  	}
                  		$cID = ($id !== false) ? $id : $modx->documentObject['id'];
                  		$args = str_replace("=",$dittoID."=",$args);
                  		$args = $dittoID.$args;
                  		$url = $modx->makeURL($cID, '', $args);
                  
                  		return $url.$this->urlString;
                  }
                  
                  


                  2. Your fix will generate &tags= at the end of pagination URLs if tags are not being used.
                    • 5074
                    • 5 Posts
                    I mis-pasted code.

                    (Wrong)
                    $tagUrl = "&tags=".$this->tags;
                    


                    (Right)
                    if( $this->tags != "" )
                     $tagUrl = "&tags=".$this->tags;
                    else
                     $tagUrl = "";
                    


                    Anyway thanks for your replay and info.
                      • 17329
                      • 53 Posts
                      Quote from: Mark at Jan 11, 2007, 01:28 AM

                      1. A google search will not see the private team development forums
                      2. Here is the link: http://modxcms.com/forums/index.php/topic,10673.30.html

                      Do we need any special rights to see that page. Being logged in the forum I still cannot see it :
                      "The topic or board you are looking for appears to be either missing or off limits to you."

                      I would like to get the code with all the corrections done since the beta2 release.
                      Thks

                      lionel