Hi,Is there a macro similar to the <<toc-selective-expandable>> that would generate an identical tree, except following the tags in the other direction from a given tiddler?I'd like to create a genealogy TW creating a separate tiddler for each family member and tagging it with two tiddlers for parents. The <<toc>> macro would produce a tree of descendants for each person. I'd like to generate a similar tree for ancestors.
I suppose, I can take the <<toc>> macro and replace all "tag[]" for "tagging[]" in the list filters and vice versa, but, perhaps, there already is a solution for this.Thanks.--Arkady
Tidgraph https://ihm4u.github.io/tw5plugs/#Tidgraph%20-%20Easy%20tiddler%20graphs%20for%20TW5 might do the job for you?
On Tuesday, November 21, 2017 at 4:28:44 AM UTC-8, PMario wrote:
Hi,
I did create a <<tocP>> macro. https://wikilabs.github.io/editions/tocP that works with fields instead of tags.
The default feeld used is: parent
Thanks. But your tree still goes in the different direction. You have children below each node, and I want parents below each node:
I
├── Father
│ ├── Paternal Grandfather
│ └── Paternal Grandmother
└── Mother
├── Maternal Grandfather
└── Maternal Grandmother
Whereas the parent-child relationship is still the same: children have two tags designating parents.
I was thinking to modify the <<toc>>
macro to and change all tagging[]
to tags[]
in the filters, but it seems more complicated than that. I need to understand how the <<toc>>
macro works. For example, I don’t understand the filter operator toc-link[no]
, and I don’t see it documented anywhere.
I found this old discussion from 2013. https://groups.google.com/forum/#!topic/tiddlywiki/67N4dBFdXCo but the <$transclude/>
widget seems to have changed since then. The current documentation does not mention template
or target
.
Thanks. But your tree still goes in the different direction. You have children below each node, and I want parents below each node:I ├── Father │ ├── Paternal Grandfather │ └── Paternal Grandmother └── Mother ├── Maternal Grandfather └── Maternal Grandmother
I’m getting what I want with this self-recurring template tiddler “ancestors”:
<ul>
<$list filter="[is[current]tags[]]">
<li>{{!!title}}</li>
{{||ancestors}}
</$list>
</ul>
It shows a list of tags for the current tiddler and then transcludes itself to show a list of tags for each of them, etc. until we run out of the ancestors. Showing ancestor tree for a given tiddler is a matter of adding {{||ancestors}}
to that tiddler. Now it’s a matter of styling - adding links, hiding buttons, etc. Hiding would require fiddling with the “state” attribute for each node. Perhaps, I’ll live without it. This is good enough.
I knew it should be simple.
On Tuesday, November 21, 2017 at 8:16:13 PM UTC-8, TonyM wrote:
Arkady,That is Quite elegant, I just eliminated the system Prefix, because it got to TableOfContents then $:/tags/SideBar in my case<ul><$list filter="[is[current]tags[]] -[prefix[$:/]]"><li>{{!!title}}</li>{{||ancestors}}</$list></ul>
And if I was using this for genealogy and each person was tagged "person" so I did not get it running off on other tags.If people we tagged male female you could also follow only the the female line.<ul><$list filter="[is[current]tags[]] +tag[person] -[prefix[$:/]]"><li>{{!!title}}</li>{{||ancestors}}</$list></ul>
Thanks. Once you use +tag[person]
, you won’t need to use -[prefix[$:/]]
or use other exclusion, I suppose, since that filters out all irrelevant tags. In my case, however, I intend to have almost all tiddlers used for people, except, perhaps, the “Home” tiddler used as an introduction. So, I want to keep it simple. I will just make sure that the people tiddlers do not tag anything but other people tiddlers. There will be maximum two tags per tiddler.
However;How are you going to use this as a generic solution for the current tiddler what ever it name?
I plan to have a similar template for descendants:
<ul>
<$list filter="[is[current]tagging[]]">
<li><$link to=<<currentTiddler>>>{{!!title}}</$link></li>
{{||descendants}}
</$list>
</ul>
To show “Ancestors” and “Descendants” for all tiddlers (except some) by default, I change the $:/core/ui/ViewTemplate/body
tiddler adding
<$list filter="[all[current]]-[[Home]]">
<!--This filter will return a list of only the current tiddler unless it's the "Home" tiddler.-->
<!--Otherwise it will return nothing, and the template will not be transcluded.-->
<!--Expand exclusion as needed or add <<exclude>> variable defined elsewhere.-->
<$transclude tiddler="AncestorsDescendantsTemplate"/>
</$list>
Then the AncestorsDescendantsTemplate
tiddler shall be
<div class="col1">
<!--Use .col1 and .col2 styles for a 2-column layout-->
! Ancestors
{{||ancestors}}
</div>
<div class=col2>
! Descendants
{{||descendants}}
</div>
This should work. I’ve used this for a task management application when I wanted different tiddlers to use different templates.
A Tiddler called$:/PSaT/macros/customfooter tagged
$:/tags/ViewTemplate containing;
<$list filter="[all[shadows+tiddlers]tag[$:/tags/ViewTemplatefooter]!has[draft.of]]" variable="listItem"><$transclude tiddler=<<listItem>>/></$list>
On Wed, Nov 22, 2017 at 12:00 AM, TonyM <anthony...@gmail.com> wrote:
Personally I would to anything not to rule out other tags, they can be so useful, if there is any thing that identifies a tiddler as a person, even one of a set like father mother that you can use so your solution is more robust is recommended.Since all but home is a person at the moment you could tag all STANDARD tiddlers "person" (automated) and remove that from Home. And update your new here/new tiddler to add the person tag for future ones.
Since the vast majority of my tiddlers are intended to be “person tiddlers”, it’s easier to have a special mark for “non-person” tiddlers. Also, tags are visible in regular views, and this attribute which serves the purpose of changing the tiddler template, does not need to be exposed to the viewer. So, in my case, I may add a “not-a-person” property to the tiddler, set it to “1” for the few “non-person” tiddlers and add -[has[not-a-person]]
to those template filters.
You are right, I may use non-person tiddlers in the future for photos, documents, or places. Those can be identified by the tiddler type or a “place” tag. I’ll deal with them when I decide to add them. I just don’t want to over-complicate this.
I recently created a Footer that goes in the View Template (and A Status Bar), A technique I used was to replicate what is found in the Viewtemplates use of Tags as well.A Tiddler called$:/PSaT/macros/customfooter tagged
$:/tags/ViewTemplate containing;<$list filter="[all[shadows+tiddlers]tag[$:/tags/ViewTemplatefooter]!has[draft.of]]" variable="listItem"><$transclude tiddler=<<listItem>>/></$list>
Then my additional footer macros are simply tagged $:/tags/ViewTemplatefooterI can now add as many additions to the footer as I want with a simple tag. I actually place buttons at the top and lists at the bottom of the footer, using draggable ordering.This means I do not modify any system tiddlers like $:/core/ui/ViewTemplate/bodyPerhaps these are useful?
Yes, this is very useful. I think, I’ll use your advice. Thanks.