After a bit of trial and error, I was able to modify the code as follows;
<!-- use kin filter to find succession of tags -->
Successors to ''<<currentTiddler>>'':
<$list filter="[title<currentTiddler>tags[]tag[Railroads]first[]]"
variable=firsttag>
<ul>
<$list filter="[title<currentTiddler>kin:tags:from[]!kin<firsttag>!title
<currentTiddler>]"> ->
<$link><$view field="title"/>
</$link>
</$list>
</ul>
</$list>
<$list filter="[title<currentTiddler>tags[]tag[Railroads]last[]]"
variable=secondtag>
<ul>
<$list filter="[title<currentTiddler>kin:tags:from[]!kin<secondtag>
!title<currentTiddler>]"> ->
<$link><$view field="title"/>
</$link>
</$list>
</ul>
</$list>
The above works just how I wanted. Since my current case never has more
than two tags, first and last will suffice. If there's ever a case where
there will be more than two, then I'll have to readdress that.
If anyone sees a simpler way of doing it, I would be more than happy to
hear what that would be. I'm sure that there is a better way to do it given
that I'm pretty much a noob at this.
Thanks,
Damon
On Saturday, May 9, 2020 at 11:09:13 AM UTC-7, Damon Pritchett wrote:
>
> Here's an example I created to illustrate.
>
> I have a series of tiddlers named RR#1 through RR#7. RR#1 will be the
> base and all others are successive tags from there. I've included some
> screenshots of the filter at work. If RR#1 is only tagged with RR#2, then I
> get what is illustrated in picture1.png. If RR#1 is only tagged with RR#5,
> then I get what is pictured in picture2.png. If RR#1 is tagged with both
> RR#2 and RR#5, which is the case I'm trying to fix, I get what's in
> picture3.png.
>
> I've thought about different ways of breaking the tiddlers up, but I can't
> get away from one tiddler being tagged with two.
>
> Tony - I'm not sure I followed the hint you were trying to give. Maybe
> it's because I haven't had enough caffeine this morning.
>
> Thanks,
>
> Damon
>
>
>
>
>
> On Saturday, May 9, 2020 at 1:42:37 AM UTC-7, TonyM wrote:
>>
>> Damon,
>>
>> It is the standard TOC that tends to work the other way, dividing into
>> branches, leaves etc... Can you ask the Question the other way around?
>>
>> If you can write an independant filter you can actually subtract one from
>> the other such as a filter than runs out all branches, then remove the
>> tiddler in the main line (not railways) the original kin filter exposed,
>> what will be left is the line of tiddlers that were not in the first
>> filter, or you can add them together.
>>
>> I know this is but a hint, not a solution but the test data is not
>> available. If you could demonstrate it on say a copy of tiddlywiki.com?
>>
>> Regards
>> Tony
>>
>> On Saturday, May 9, 2020 at 2:27:42 PM UTC+10, Damon Pritchett wrote:
>>>
>>> All,
>>>
>>> I've been using the following code which encompasses the kin filter to
>>> trace tiddler tags. More specifically, I'm using it trace the line of
>>> mergers for certain railroads (each railroad is a separate tiddler) such
>>> that for any given company I can see the line of successive
>>> railroads traced all the way up to the present.
>>>
>>> <!-- use kin filter to find succession of tags -->
>>> <$list filter='[all[current]title<currentTiddler>
>>> kin:tags:from[]!is[system]!title[Railroads]!title<currentTiddler>limit[1]]'
>>> variable=null>
>>> Successors to ''<<currentTiddler>>'':
>>> <br>
>>> </$list>
>>> <ul>
>>> <$list filter="[title<currentTiddler>
>>> kin:tags:from[]!is[system]!title[Railroads]!title<currentTiddler>]"> ->
>>> <$link><$view field="title"/>
>>> </$link>
>>> </$list>
>>> </ul>
>>>
>>>
>>> It generally works quite beautifully, but I have a very small number of
>>> cases where I have where the railroad was split and merged into two
>>> different companies. The above code includes everything, but shows all as a
>>> single line of succession. I'm pretty sure that the kin filter was only
>>> meant to trace a succession of single tags so I'm wondering if there is
>>> something I can do to the code above or I'll have to figure out a way to
>>> split tiddlers. Any suggestions will be welcomed.
>>>
>>> Thanks,
>>>
>>> Damon
>>>
>>
--
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/d028a335-067c-4123-b163-c9bbb9c83240%40googlegroups.com.