Just for conversation's sake, download the attached and drag it into 
tiddlywiki.com .

On Monday, September 20, 2021 at 5:36:59 AM UTC-3 [email protected] 
wrote:

> Thanks for the hints, 
> I am understanding more about TW5 and learning, but still no cigar.
>
> I will explain what i am trying to achieve it may make things easier 
> (feels like there will be a pre-canned solution out there). I have added a 
> fair amount of content to a wiki +80 pages, diagrams and tiddlymap all 
> working well, there are common tags that are reused to assist with 
> classification and content. I am was hoping to provide an interactive, easy 
> to use search page that lets the end readers narrow down the pages with a 
> combination of tags, it may take about 3 tags to find the pages you are 
> looking for, but could be more. I understand that i can do this in advance 
> search - just trying to make it easy for others with pulldowns, and no 
> typing...etc.
>
> I feel like i am getting closer, and have found the source of the original 
> macro i used, but still not the result i am looking for, looks like the 
> macro i found and tried to use is too old. (skip the rest of this paragraph 
> if you dont need the detail ). The example tagfilter() i found and tried to 
> implement looks like it was created a while ago as an example by @tobibeer 
> and may not actually have made it into the core (
> http://tagfilter.tiddlyspot.com/). The online tagfilter shown in the link 
> does filter and work the way i wanted it to with AND logic, however when i 
> have added it to my wiki it works with OR. From reading comments in github 
> it looks like the changes to "tagging" that this macro used were not 
> actually added to core and it was superseded by the "contains:tags" filter 
> logic. I tried adding more of what is listed as dependencies in github for 
> the macro but ended up with lots of javascript errors and crash on startup, 
> (did manage to recover from backup) .
>
> In that old macro, i think this line that filters and displays the list 
> is  this one
>     [all[current]tags[]tagging:all[]]
> where it is taking the list of tags that the user has selected ("current" 
> and have been added to a temp page) and finding all the tiddlers that 
> *some* contain the same tags, where i want it to contain *all* of the same 
> tags. From reading i need to replace that part with something that includes 
> "contains:" (maybe) 
>
> What i am trying to achieve in English is.. "How do i find a list of all 
> pages that contain all the tags of the current temp page?"
>
> Once again thanks in advance,
> Pete
>
>
>
> On Sunday, 19 September 2021 at 12:51:00 am UTC+10 [email protected] 
> wrote:
>
>> G'day Pete,
>>
>> Although that stretch of code is too big and complicated for me to wrap 
>> my mind around it, I've thrown two sample filters into TiddlyWiki.com's 
>> Advanced Search tiddler and did a couple of screen captures (attached), 
>> just to show the basics of setting up "and" vs "or".
>>
>>
>>
>> On Friday, September 17, 2021 at 5:59:34 AM UTC-3 [email protected] 
>> wrote:
>>
>>> Hey Guys
>>> Apologies if this is a duplicate. This could be a simple answer but i 
>>> have been looking at it for days and still not getting there.
>>> I am using a macro i found on the web called tagfilter 
>>> ($:/.tb/macros/tagfilter), just had another look and i can't see where i 
>>> got it from. Its pretty simple just pick a set of tags and then lookup the 
>>> pages that match and display the list. I want to modify it so that it just 
>>> returns the ones that have ALL of the tags picked rather than ANY.
>>> I think the line in the macro that is doing the filter is this
>>>
>>> <$list 
>>> filter="[!is[system]sort[]]+[all[current]tags[]tagging:all[]]+[sort[]]-[all[current]]"
>>>  
>>> template="$template$"/>
>>>
>>> I think its the "tagging" part that is picking up pages with ANY of the 
>>> tags... question is what do i replace it with?
>>>
>>> This is the full macro incase i am misleading people on the line that is 
>>> doing the filter
>>>
>>> \define lingo-base() $:/language/EditTemplate/
>>>
>>> \define 
>>> tagfilter(filter:"[!is[system]sort[]]",state:"$:/temp/TagFilter", 
>>> template:"$:/core/ui/ListItemTemplate")
>>> <$set name=state value="$state$">
>>> <$tiddler tiddler=<<state>>>
>>> <$set name=tags filter="[all[current]tags[]]">
>>> <$set name="addtags" filter="
>>> $filter$
>>> +[all[current]tags[]tagging:all[]]
>>> -[all[current]]
>>> +[tags[]]
>>> -[all[current]tags[]]">
>>>
>>> <$fieldmangler>
>>> <$list filter="[all[current]tags[]sort[title]]" storyview="pop">
>>> <<tag mode:"remove">>
>>> </$list>
>>>
>>> <$reveal type=nomatch text="" default=<<addtags>>>
>>> <$reveal type=match text="" default=<<tags>>>
>>> <span class="tc-subtitle">Filter by:</span>
>>> </$reveal>
>>> <$button popup=<<qualify "$:/state/popup/tags-auto-complete">> 
>>> class="tc-btn-invisible tc-btn-dropdown" 
>>> tooltip={{$:/language/EditTemplate/Tags/Dropdown/Hint}} 
>>> aria-label={{$:/language/EditTemplate/Tags/Dropdown/Caption}}>{{$:/core/images/new-button}}</$button>
>>> </$reveal>
>>> <$reveal type=match text="" default=<<tags>>>
>>> <span class="tc-subtitle">Filter by:</span>
>>> <$button popup=<<qualify "$:/state/popup/tags-auto-complete">> 
>>> class="tc-btn-invisible tc-btn-dropdown" 
>>> tooltip={{$:/language/EditTemplate/Tags/Dropdown/Hint}} 
>>> aria-label={{$:/language/EditTemplate/Tags/Dropdown/Caption}}>{{$:/core/images/new-button}}</$button>
>>> </$reveal>
>>>
>>> <div class="tc-block-dropdown-wrapper">
>>> <$reveal state=<<qualify "$:/state/popup/tags-auto-complete">> 
>>> type="nomatch" text="" default="">
>>> <div class="tc-block-dropdown">
>>> <$edit-text tag="input" default="" placeholder="Filter tags" 
>>> class="tc-edit-texteditor tc-popup-handle" focus="true"/>
>>> <$linkcatcher set=<<state>> setTo="" message="tm-add-tag">
>>> <$reveal type=match text="" default=<<tags>>>
>>> <$list filter="$filter$ +[tags[]!is[system]search{$state$}sort[]]">
>>> <<tag mode:link>>
>>> </$list>
>>> </$reveal>
>>> <$reveal type=nomatch text="" default=<<tags>>>
>>> <$list filter="
>>> $filter$
>>> +[all[current]tags[]tagging:all[]]
>>> +[tags[]!is[system]search{$state$}sort[]]
>>> -[all[current]tags[]]">
>>> <<tag mode:link>>
>>> </$list>
>>> </$reveal>
>>> </$linkcatcher>
>>> </div>
>>> </$reveal>
>>> </div>
>>> </$fieldmangler>
>>> <$reveal type=match text="" default=<<tags>>>
>>> <$list filter="$filter$" template="$template$"/>
>>> </$reveal>
>>> <$reveal type=nomatch text="" default=<<tags>>>
>>> <$list filter="
>>> $filter$
>>> +[all[current]tags[]tagging:all[]]
>>> +[sort[]]
>>> -[all[current]]" template="$template$"/>
>>> </$reveal>
>>> </$set>
>>> </$set>
>>> </$tiddler>
>>> </$set>
>>> \end
>>>
>>> Thanks in advance - Pete
>>>
>>>
>>>
>>>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/75ed8572-4e8a-47a6-b449-5a78bddb27ban%40googlegroups.com.

Attachment: Search Tiddlers By Tag.json
Description: application/json

Reply via email to