We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 15987
    • 786 Posts
    wow, I’m not sure why it would jump that high, the code just uses the api function getDocumentchildren and getTemplateVarOutput. There probably could be a better way of writing it to get all of the docs at once and the tv value, if I have time I will look into it.
      • 21512
      • 7 Posts
      Quote from: kylej at Mar 06, 2007, 07:19 AM

      In the snippet replace the line:
      $subEntities = $modx->getDocumentChildren($parent);
      


      with this

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

      Now it works smiley ($parent -> $parentDoc in foreach())
        • 17883
        • 1,039 Posts
        I don´t know where exactly the problem is, but since 2.0 there is a display error with utf8 encoded values like ÖÜÄ (shown as question marks, so some encoding problem). No problem with 1.0 on the same page.
          • 867
          • 241 Posts
          Hi,

          I’m using Tv Tag cloud V1. It works fine but when i’m making a change in a Tag i’m still getting
          the old one.
          (like if there is a mispelling I got them twice). How can I change that ?

          My pages are uncached.

          As it’s a old web site i’not willing to change to the v2 (wich need ditto2) if possible

          Thanks in advance !

          Edit : My bad. Actualy it’s just necessary to save again with the new tag.
            • 21056
            • 327 Posts
            Quote from: kylej at Mar 21, 2007, 07:16 AM

            wow, I’m not sure why it would jump that high, the code just uses the api function getDocumentchildren and getTemplateVarOutput. There probably could be a better way of writing it to get all of the docs at once and the tv value, if I have time I will look into it.

            I’m having similar trouble (on a Ditto 1 / TvTagCloud 1 site). The page is generating an additional 791 queries when this snippet is in, making it noticably slow to load. I’ve done some work on rewriting it to reduce the number of calls, but it needs a bit more work.
              Author: ManagerManager plugin - customise your ModX manager interface

              Rckt - web development, Sheffield, UK
              • 18397
              • 3,250 Posts
              @ncrossland: Use TvTagCloud 2. It was rewritten for that express purpose, using only 1 query.
                • 5811
                • 1,717 Posts
                I use tvTagCloud 2.0 with Modx0.9.6 and Ditto 2.0.2 with utf8 encoding characters and i meet some trouble for accentuated words.
                When i catch the word Sibérie as tag in my TV, it ’s displaying as sib?rie in the tagcloud.

                As i understand the trouble comes from the usage of the strtolower function in the snippet. This function breaks the content of the tag. See line 139.

                To avoid this trouble use the mbstring function mb_strtolower function instead of strtolower function.

                mb_strtolower($tags,’UTF-8’) is correct and displays "sibérie" rather than sib?rie"

                Be carefull for this fix, the the php module mbstring should be activated on your server.
                  • 17622
                  • 39 Posts
                  Hi,

                  I’ve just tried to include TvTagCloud as a sidebar on my site but I’m getting the following error:

                  « MODx Parse Error »
                  MODx encountered the following error while attempting to parse the requested resource:
                  « Execution of a query to the database failed - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') ORDER BY stc.contentid ASC' at line 1 »
                        SQL: SELECT stv.name,stc.tmplvarid,stc.contentid,stv.type,stv.display,stv.display_params,stc.value FROM `mymodxdb`.`modx_site_tmplvar_contentvalues` stc LEFT JOIN `mymodxdb`.`modx_site_tmplvars` stv ON stv.id=stc.tmplvarid WHERE stv.name='ai-document-tags' AND stc.contentid IN () ORDER BY stc.contentid ASC;
                  


                  I’m using MODx 0.9.6 and TvTagCloud 2.0.

                  I’ve created a TV:

                  Variable Name: ai-document-tags
                  Input Type: List-Box (Multi-Select)
                  Input Option Values: Ada||Ada83||Ada95||Ada 2005||C||C++
                  Widget: Delimited List
                  Delimiter: ,

                  Then I’ve created a chunk which is called liked this:

                  [!TvTagCloud? &parent=`1` &landing=`30` &tvTags=`ai-document-tags` &showCount=`1` &tagDelim=`,` &displayType=`cloud`!]
                  


                  This chunk is then called within another TV which is used to select which sidebars are displayed on which pages.

                  Thanks,
                  Luke.
                    • 17622
                    • 39 Posts
                    Hi,

                    I’ve got the snippet to work, by replacing the parent=`1` with `0` to count the entire site. Now I’ve a different problem. The tag cloud only dumps out the tags that are specified for that document, not the entire cloud!

                    I’ve got 2 pages with the tag "Ada95" selected and when I click on tag, I get "No documents found" from Ditto. I’m using this call on the landing page:

                    [[Ditto? &startID=`1` &tagData=`tvai-document-tags` &tagDelimiter=`,`]]
                    


                    I believe this call is wrong as I can’t find the startID parameter in the Ditto docs. Also the tagging screencast doesn’t prepend "tv" to the TV name.

                    Can anyone point me in the right direction of getting this to work the way I expect it to?

                    Thanks,
                    Luke.
                      • 5811
                      • 1,717 Posts
                      Hi Luke,

                      As i used tagcloud in this moment, i put yout TV "ai-document-tags" on my page as tests.

                      I put the following call directly inside the template and i get the correct tagcloud on my page

                      [!TvTagCloud? &parent=`7` &landing=`7` &tvTags=`ai-document-tags`!]

                      The document #7 is the folder document where all the tagged documents are gathered.

                      And i use the following call for ditto on this page (document #7)
                      [!Ditto? &tpl=`lvvItemList` &parents=`7` &paginate=`1` &display=`5` &extenders=`summary,tagging` &tagData=`ai-document-tags` &tagDelimiter=`,` &sortBy=`lvvDate` &truncText=`Lire la suite...`!]

                      The result is correct.

                      To fix your troubles with Ditto some suggestions :
                      - the extender tagging is required if you use &tagData
                      - &startID is now deprecated. use &parents

                      The parent page should be the root of a document tree wich contains tagged documents.