Alrighty then. After a bit of trial and error and realizing that there were 
other considerations when a tiddler has a succession of two tags, but then 
those two tags have a common single tag and also having to make sure that I 
didn't break the normal case where only one tag was involved (whew!), I 
came up with the code below. It does work for all cases that I've come 
across so far in my TW. I know that it only handles the case when there is 
a single tag or two tags, but not more than two. It was definitely a 
learning experience. Now the trick will be to remember those lessons 
learned.

I would appreciate any feedback if anyone sees a simpler or more generic 
way of doing it or there is something fundamentally wrong with the way I 
did it.

<!-- use kin filter to find succession of tags -->


<$list filter="[title<currentTiddler>
tags[]tag[Railroads]count[]compare:number:eq[1]then<currentTiddler>]">
  Successors to ''<<currentTiddler>>'':
  <ul>
    <$list filter="[title<currentTiddler>
kin:tags:from[]!is[system]!title[Railroads]!title<currentTiddler>]"> ->
      <$link><$view field="title"/>
      </$link>
    </$list>
  </ul>
</$list>


<$list filter="[title<currentTiddler>
tags[]tag[Railroads]count[]compare:number:gt[1]then<currentTiddler>]">
  Successors to ''<<currentTiddler>>'':
  <$list filter="[title<currentTiddler>tags[]tag[Railroads]first[]]" 
variable=firsttag>
  <$list filter="[title<currentTiddler>tags[]tag[Railroads]last[]]" 
variable=secondtag>
    <ul>
      <$list filter="[title<firsttag>
kin:tags:from[]!is[system]!title[Railroads]!title<currentTiddler>]"> ->
        <$link><$view field="title"/>
        </$link>
      </$list>
    </ul>
    <ul>
      <$list filter="[title<secondtag>
kin:tags:from[]!is[system]!title[Railroads]!title<currentTiddler>]"> ->
        <$link><$view field="title"/>
        </$link>
      </$list>
    </ul>
  </$list>
  </$list>
</$list>


-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/be2b8fe7-ad8f-4ff1-88e5-3739faf825af%40googlegroups.com.

Reply via email to