We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 27376
    • 576 Posts
    This is my first real delve in to the new ditto 2 system (previously used my own system tailored to my needs), and I have one question before I’ll start moving all my current snippet calls to ditto calls:

    I like tagged articles, I have the tagging system working correctly, with some modifications. My tags are held in a separate db and my TV looks like this:
    Name: NewsCategories
    Input Type: Check Box
    Input Option Values: @SELECT subject, id FROM rsd_newscategories ORDER BY subject ASC
    Widget: Delimited List
    Widget Properties: &format=,

    This method stores the id as the value of the TV (This is equal to writing out ’option==value||option2==value2’). It allows me to change the tag value (subject) without having to go through and re-tag all my documents with the new value.

    The problem is this: because the id is stored as the content value and not the actual string I want to display, is there some sort of filter I can run the TV output through to change the id to the subject?

    My Ditto call: [tt][!Ditto? &debug=`1` &parents=`40` &tpl=`dittoBlog` &summarize=`all` &tagData=`NewsCategories` &tagDelimiter=`,`!][/tt]

    The debug output is attached (remove ’.txt’ from the end), the template I’m using is contained within it.

    The [+tagLinks+] output is like this: [tt]<a href="/news.html?tags=15&amp;amp;start=0" class="ditto_tag" rel="tag">15</a>,<a href="/news.html?tags=18&amp;amp;start=0" class="ditto_tag" rel="tag">18</a>[/tt]

    Instead of it linking the id of the tag, is there a filter I can run the tag output through so I can convert it to something else?

    Thanks!
      • 27376
      • 576 Posts
      Any ideas? Or is this not possible?

      I’d like to use the Ditto snippet, but this is the only feature missing that I need before I can start using it. Any help would be appreciated.

      Thanks!
        • 18397
        • 3,250 Posts
        There is no such feature currently built into Ditto. It is currently in the plans to make tagLinks templateable (see here) which would let you capture the tag and run it through a snippet.

        However, in the meantime you can modify the tagging extender to suit your needs by editing the tagLinks function.
          • 27376
          • 576 Posts
          Thanks Mark! I’ll do some research. I wasn’t expecting it to be a built-in feature since it’s so specific, but if it’s at least possible I’ll pursue it, and post my findings.

          Thanks again smiley
            • 18397
            • 3,250 Posts
            Upon re-reading your post I think the function that makes more sense to modify (semantically at least) would be combineTags since you don’t want to change the output, just the tags themselves.