We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 23183
    • 102 Posts
    I’m trying to retrieve documents using introtext as the tagData field. In all cases introtext just contains one word (no deliimiter). My ditto call is:

    [!Ditto? &startID=`3` &tpl=`newbrandlist` &orderBy=`pagetitle ASC` &display=`all`  &paginate=`0`  &extenders=`tagging` &paginateAlwaysShowLinks=`0` &tagDelimiter=`, `  &tagData=`introtext` &tags=`[*womenbrand*], [*menbrand*]` &tagMode=`onlyTags`!]


    womenbrand and menbrand both contain tags seperated by ’, ’

    e.g tag1, tag2, tag3

    But the correct documents are not returned, in some cases a few of the documents are returned, in other cases none of them are. There are well over 500 documents to search through.

    I cant work out what the problem is, sometimes the tags are repeated more than once in the tag list (didnt think this would cause a problem though). Also in the tagData field there is always only one tag so no delimiter, but also didnt think this would cause a problem and doesnt explain how sometimes some results are returned ..
      • 23183
      • 102 Posts
      OK, I found out one thing that is causing the problem when a tagData field contains an "&" symbol it breaks and no more results are shown. Is there a fix for this without removing all "&"?

      Im still not sure if this is the only problem as is some cases the last few results are still missed off even when there is no "&" in the tagData..

      Thanks
        • 23183
        • 102 Posts
        I found this: http://modxcms.com/forums/index.php?topic=21974.0

        but cant get hte fix to work.. not 100% sure where to add the second part of the code
          • 23183
          • 102 Posts
          Changed title to reflet problem, I just realised on some other ditto calls where I was using ampersands in the tagData they were not returing any results either sad

          Anyone no if there is a fix for this?

          If not I will remove all teh ampersands from all the tagData fields but that will probably take some time :/
            • 3749
            • 24,544 Posts
            Without hacking the code, I think you’ll have to remove them or replace them with ’+’ or ’and’ or something else. Test to make sure whatever you replace them with doesn’t cause trouble before changing all of them.

            If they are all template variables and you don’t have the ampersands in the input option values or default values of the TVs, you might be able to do it faster with PhpMyAdmin, though it’s a little risky.

            You’d do it by exporting the modx_site_tmplvar_contentvalues table, editing it, and importing it. Be sure to save the original export as a backup (with a different name) and import to the same table you exported from and be very careful not to change anything else in the .SQL dump file.

            In theory, you could do a search and replace of the ampersands in the .SQL dump file assuming that all the ones in there are in the TV fields.
              Did I help you? Buy me a beer
              Get my Book: MODX:The Official Guide
              MODX info for everyone: http://bobsguides.com/modx.html
              My MODX Extras
              Bob's Guides is now hosted at A2 MODX Hosting