We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 867
    • 241 Posts
    It seems to work ! grin

    I just found out that my ditto call was with a small d and that snippet ’s call is Ditto..

    wink happy to find this one !!!

    Thanks the precedant help.

    I let you all know if anything is ok. (or not obviously wink )

    Alchime
      • 867
      • 241 Posts
      Is it possible to use TvTagCloud to show a list of links for the tags of ONE page ?
        • 15987
        • 786 Posts
        Currently you can only specify a parent and all child documents will be used. You would have to modify the code, which I do not have with me atm. to get a single page.
          • 21056
          • 327 Posts
          I’d like to suggest an amendment to the code.

          The current snippet does not trim whitespace around individual tags - so if a document author puts in tags such as:

          Doc 1: tag1, tag2, tag3
          Doc 2: tag2, tag3

          the snippet will treat tag2 and <space>tag2 as separate items, which since multiple spaces don’t show in HTML gives an output of:

          tag1 tag2 tag2 tag3

          This is easily fixed by adding:

          $array_content = array_map("trim", $array_content);


          after


          $array_content = explode($tagDelim, $content); //split them in separate words
            Author: ManagerManager plugin - customise your ModX manager interface

            Rckt - web development, Sheffield, UK
            • 12652
            • 228 Posts
            I was hoping that this would handle child folders, but it doesn’t appear too.

            I tried creating containers for 2006 and 2007 and moved documents inside the respective folders.

            But now all that shows up on my main page where the call is made is this: (1) with no tags listed.
              | Identity Developments delivers SEO focused web design and web presence services
              - it&#39;s not about websites, it&#39;s about your identity. |
              • 15987
              • 786 Posts
              identity,
              In the snippet replace the line:

              $subEntities = $modx->getDocumentChildren($parent);
              


              with this

              $parents = explode(',',$parent);
              $subEntities = array();
              
              foreach ($parents as $parentDoc) {
              	$subDocs = $modx->getDocumentChildren($parent);
              	$subEntities = array_merge($subDocs,$subEntities);
              }
              


              then you should be able to specify multiple parents in the snippet call, i.e. &parent=`3,10`

              I have not tested this, but I think it should work (I don’t have a setup to run it on atm).

              Hope that helps.

              Kyle
                • 12652
                • 228 Posts
                Kyle,

                thanks for the code. I switched the code as recommended...

                It doesn’t appear to work unfortunately. Although, it doesn’t seem to break anything either.

                I tried moving one of the docs, and the count for that tag decreased by one.

                Then I thought that maybe it was because the container it was in was unpublished, but that didn’t have any effect, other than the container itself showing up in my ditto call, so that wouldn’t work even if it did work.

                Open to any other suggestions.
                  | 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
                  Had to modify (thanks ApoXX for the direction) my snippet installation to work with SEO Strict URLs because the tag parameter was being passed with an "&" instead of "?"

                  Here is the section of code (at the end of the snippet) with the changes and I’ve commented out and left the 2 original lines.

                  foreach ($words as $key => $value) {
                  	if ($showCount) {
                  		$countvalues = '(' . $value . ')';
                  	}
                  	if ($displayType == 'cloud') {
                  //		$output .= '<span><a class="' . $styles[$wordStyles[$key]] . '" href="[~' . $landing . '~]&tags=' . $key . '">' . $key . $countvalues . '</a></span>';
                  		$output .= '<span><a class="' . $styles[$wordStyles[$key]] . '" href="[~' . $landing . '~]?tags=' . $key . '">' . $key . $countvalues . '</a></span>';
                  		$output .= "\r\n";
                  	} else {
                  //		$output .= '<li><a href="[~' . $landing . '~]&tags=' . $key . '">' . $key . ' ' . $countvalues . '</a></li>';
                  		$output .= '<li><a href="[~' . $landing . '~]?tags=' . $key . '">' . $key . ' ' . $countvalues . '</a></li>';
                  		$output .= "\r\n";
                  	}
                  }
                  

                    | Identity Developments delivers SEO focused web design and web presence services
                    - it&#39;s not about websites, it&#39;s about your identity. |
                    • 19726
                    • 239 Posts
                    Actually both methods are not correct. If people are not using Friendly Urls then the following type of links will be generated: "http://your.domain.ext/index.php?id=2?tags=$key" with the new solution. It would be better to make use of the $modx->makeUrl function to generate the links since that function takes the friendly URL settings into account.

                    That would make the first line look something like this:
                    $output .= ’<span><a class="’ . $styles[$wordStyles[$key]] . ’" href="’.$modx->makeUrl($landing, ’’, "tags=$key") . ’">’ . $key . $countvalues . ’</a></span>’;

                      • 18397
                      • 3,250 Posts
                      I was running some speed tests with tagging and added TvTagCloud in to see all of my tags in a nice list. Works great. Then I noticed something. The number of MySQL requests went from 12 (on the blank page) to 126 when I added:

                      <h2>Tags</h2>
                      [!TvTagCloud?startId=`2`&tvTags=`myTags`&landing=`2`&tagDelim=` `&showCount=`1`!]
                      


                      Thats with only 4 pages in the Blog container (2). It appears there is a bug somewhere...

                      Has anyone experienced this before?