Hi there...
Great improvement of Ditto
Something I would like to do. I’ve tried on previous Ditto’s version since I installed this one. My problem is with filters.
With tagMode, we can control the comportement. But there’s one that is not implemented.
I use multiple tags (2 and more) with Tv.
When you use "onlyTags", it selects pages with one of them.
When you use "onlyAllTags", it selects pages only if you gave it all the tags of the Tv.
What I want to do, is to select pages with all the tags that I put in my url.
An exemple:
Tv Page1: test1,test2,test3
Tv Page2: test2,test3,test4
- Url: &tags=test1,test2 -> result: Page1 (actually: onlyTags -> Page1 AND Page2; onlyAllTags -> none)
- Url: &tags=test2,test3 -> result: Page1 AND Page2 (actually: onlyTags -> Page1 AND Page2; onlyAllTags -> none)
- Url: &tags=test3,test4 -> result: Page2 (actually: onlyTags -> Page1 AND Page2; onlyAllTags -> none)
- Url: &tags=test1,test4 -> result: none (actually: onlyTags -> Page1 AND Page2; onlyAllTags -> none)
- Url: &tags=test1,test2,test3 -> result: Page1 (actually: onlyTags -> Page1 AND Page2; onlyAllTags -> Page1)
I’ve tried to hack filters, but nothing like this for the moment :/
(sorry for my english :p)
Yeah, the forum search is pretty horrible. Even if you search for "quirkiness", which is in the subject of this thread, it returns nothing. Google site:modxcms.com works better.
Hu^^ i made a search to foucnd a topic like this with no results. Maybe I used wrong words :p
I’ve tried that, but onlyTags returns every single document regardless of tags (as far as I can tell). I’d bet that if you put &tags=test1 (per your example), it’d actually return Page1 and Page2 (with onlyTags), and nothing with onlyAllTags.
The comportement of onlyAllTags is that it returns the documents with exactly the same tags. That’s why it returns only the docB in your previous exemple.
I’d try to use onlyTags but it returns all documents with one of the tags.
I’ve tried that, but onlyTags returns every single document regardless of tags (as far as I can tell). I’d bet that if you put &tags=test1 (per your example), it’d actually return Page1 and Page2 (with onlyTags), and nothing with onlyAllTags.Nothing for onlyAllTags but it returns Page1 only with onlyTags... for me :p
I think I’m having the exact same issue that Zap just fixed here. That might work for your problem with the filter, but doesn’t seem to work for tags (even though as far as I can tell it should).I don’t use filters but tags... but I will test this solution.
Are you sure onlyAllTags only returns when the tags are exact (no more, no less)? I thought it was when the doc had at least all the tags being called by Ditto. That’s how I read Mark’s comment above. Mark, can you confirm? So... with onlyAllTags...After another test, it works like Mark said

True
&tags=test1,test2 should return Page1, right? That’s definitely not working.
With onlyTags...This one works for me... :/
&tags=test1 should return Page1 and not Page2.
And that’s not working for me either. Can you test that on your end and see if onlyTags works for you?
function tagFilter ($value) {
$this->filterValue = $this->tags;
$documentTags = explode($this->tagDelimiter, $this->filterValue);
$filterTags = explode($this->tagDelimiter, $this->combineTags($this->tagData, $value));
$compare = array_intersect($filterTags, $documentTags);
$commonTags = count($compare);
$totalTags = count($filterTags);
$unset = 1;
switch ($this->filtertype) {
case "onlyAllTags" :
case 7 :
if ($commonTags != $totalTags)
$unset = 0;
break;
case "removeAllTags" :
case 8 :
if ($commonTags == $totalTags)
$unset = 0;
break;
case "onlyTags" :
case 9 :
if ($commonTags > $totalTags || $commonTags == 0)
$unset = 0;
break;
case "removeTags" :
case 10 :
if ($commonTags <= $totalTags && $commonTags != 0)
$unset = 0;
break;
}
return $unset;
}
Help Help!