As I was thinking about what Mat had suggested, I had a thought. I realized 
that I had to reverse the order of the list filters and all is well. Here's 
the new code.

\define each-other-level()
  <ol>
    <$list filter=
"[title<currentTiddler>tagging[]sortan[birth]tags[]!title<currentTiddler>]">
      <li>
        with: <$link><$view field='caption'><$view field='title'/></$view></
$link>
        <$list filter=
"[title<currentTiddler>tagging[]limit[1]has[parents-marriage]]">
          -> married: <$macrocall $name="date-str" date={{!!parents-marriage
}}/>
         </$list>
        <ol>
          <$list 
filter="[title<currentTiddler>kin:tags:to:1[]sortan[birth]!title<currentTiddler>]">
            <li>
              <$link><$view field='caption'><$view field='title'/></$view></
$link> -> born: <$macrocall $name="date-str" date={{!!birth}}/>
              <<each-other-level>>
            </li>
          </$list>
        </ol>
      </li>
    </$list>
  </ol>
\end


\define descendants()
  <<each-other-level>>
\end




On Saturday, June 27, 2020 at 4:27:54 PM UTC-7, Damon Pritchett wrote:
>
> All,
>
> I've spent the last few days working on a new wiki for use with my family 
> history. I'm going to use it, not as a substitute for my genealogy program, 
> but as a supplement to keep track of documentation and such. In so doing, 
> I've managed to figure out a nice way of using tidgraph to generate my 
> pedigree chart and I've written a "children of" using nested list widgets. 
> I have tiddlers for each person with that person's parents as tags. With 
> tidgraph, I was able to get the desired behavior by using mode="tags[]" 
> instead of tagging which is the default. Tidgraph is a wonderful plugin and 
> it's too bad that it doesn't seem to be supported any longer. I'm still 
> learning Javascript, so am a long way from making any changes to it myself.
>
> I've created a ViewTemplate that I've included here:
> \import [title<currentTiddler>]
>
> <$list filter="[all[current]search:description[People]]">
>
> <div class="tc-tiddler-body" style="border: none;">
>
>
> <$tidgraph start=<<currentTiddler>> mode="tags[]sort[sex]reverse[]" 
> maxdepth="2" nocollapse />
>
> <$list filter="[all[current]has:field[birth]] 
> [all[current]has:field[death]]">
> <table class="highlight1">
>   <caption style="text-align: left; font-weight: bold; caption-side: 
> top;">Birth / Death:</caption>
>   <tr>
>     <td>Birth</td>
>     <td><$macrocall $name="date-str" date={{!!birth}}/></td>
>     <td><<birthplace>></td>
>   </tr>
>   <tr>
>     <td>Death</td>
>     <td><$macrocall $name="date-str" date={{!!death}}/></td>
>     <td><<deathplace>></td>
>   </tr>
> </table>
> </$list>
>
> <$list filter="[all[current]]" variable="Parent">
>
> <$list filter="[all[current]tagging[]search:description[People]limit[1]]" 
> variable=null>
>
> <div class="list-tree">
>   Children of <<currentTiddler>>:
>   <ol>
>     <$list 
> filter="[title<currentTiddler>tagging[]sortan[birth]tags[]!title<Parent>]">
>       <li>with: <$link><$view field='caption'><$view 
> field='title'/></$view></$link>
>         <$list 
> filter="[title<currentTiddler>tagging[]limit[1]has[parents-marriage]]">
>           -> married: <$macrocall $name="date-str" 
> date={{!!parents-marriage}}/>
>         </$list>
>         <ol>
>           <$list filter="[title<currentTiddler>tagging[]sortan[birth]]">
>             <li><$link><$view field='caption'><$view 
> field='title'/></$view></$link> -> born: <$macrocall $name="date-str" 
> date={{!!birth}}/></li>
>           </$list>
>         </ol>
>       </li>
>     </$list>
>   </ol>
> </div>
>
> </$list>
>
> </$list>
>
> <$list 
> filter="[all[current]backlinks[]!search:description[People]!is[missing]limit[1]]"
>  
> variable=null>
>
> <<table-dynamic 
> filter:"[title<currentTiddler>backlinks[]!search:description[People]]" 
> fields:"tbl-expand record-date description title" sortOp:sortan 
> stateTiddler:"recordsearch" class:"highlight1" editButton:no 
> caption:"''Mentioned or connected with the following records:''">>
>
> </$list>
>
>
> </div>
>
> </$list>
>
>
> The result is this:
>
>
>
> I'm suing the class "list-tree" which has been around for quite a while 
> and created by Mat. There's also a dynamic table called out from the Shiraz 
> plugin that I use to show any documents that the person is listed in.
>
> This all works just how I want it to work, but being that my skills at 
> Tiddlywiki are still forming, I'm wondering if there might be a more 
> efficient or effective way of doing the same thing. I am definitely open to 
> any better ways of doing things.
>
> I'm also thinking of expanding the "children of" code to a recursive macro 
> to get multiple generations, but I don't know exactly how to proceed down 
> that path. Any suggestions would be highly appreciated.
>
> Feel free to use this code if you think you'd find it useful. I only ask 
> that, if you make any improvements or additions, that you let me know so I 
> might incorporate those.
>
> 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 tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/ab951224-baa1-4468-8b17-805fdffde87fo%40googlegroups.com.

Reply via email to