We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 32645
    • 377 Posts
    Yes I agree with the mainteance nightmare part!

    I’ve noticed that there is a "&tagCallback" feature;


    URL: tagCallBack on Ditto Wiki

    "Allow the user to modify both where the tags come from and how they are parsed."

    "The function should expect to receive the following three parameters: tagData - the provided source of the tags resource - the resource array for the document being parsed array - return the results in an array if true".

    I built a plugin with the aforementioned function with tagData and ResourceArray and outputted it, hoping that I’d be able to catch the delimiter and do something with it... it works, but it does not return the delimiter, which is a shame -- because then I could explode it, and force it to use something else.

    I’ve searched the form, but there appears to be no topics for tagCallBack. Does anyone have more info on tagCallBack, how to use it, an example etc?

    Thanks.
      • 6726
      • 7,075 Posts
      Good catch... I think you should start another thread if you want to get appropriate help.

      Maybe post in the Module, Plugin & Snippet Creation and Modification forum, either here @Ditto forums but definitely a new thread is warranted.
        .: COO - Commerce Guys - Community Driven Innovation :.


        MODx est l'outil id
        • 32645
        • 377 Posts
        Ugh!

        Turns out all we had to do was use the &filter parameter instead of tagging, as filter allows to choose from different possible variables.

        The filter will allow me to choose the correct attribute, such as the array captured by a checkbox.

        It now works fine on checkbox TV data, and correctly filters the data as required; and it works much better than tagging, which looks like is only designed to handle simple text entry.

        /*
        This is just an example of what we did in the Ditto call.
        */
        [!Ditto?debug=`1` &tpl=`exampleTpl` &tplAlt=`exampleTplAlt` &parents=`1` &filter=`Teams,[[Get?name=team_id]],7` &showInMenuOnly=`1` &noResults=`Sorry, no videos` &id=`teamInfo` &extenders=`summary` &truncLen=`150`!]
        


        So in summary. If you’re trying to perform a data filter on tags, use filter. Not tags.
          • 6726
          • 7,075 Posts
          Of course !

          So simple and efficient, I wouldn’t have thought of it I read "tags" and didn’t think outside the tag box !
          Yes filters are very powerful once you grasp how they work...

          Thanks for sharing the code smiley
            .: COO - Commerce Guys - Community Driven Innovation :.


            MODx est l'outil id