A howto: Dynamic content include/exclude, and dynamic "DetailsWidget" title

85 views
Skip to first unread message

Charlie Veniot

unread,
Dec 7, 2020, 7:55:32 PM12/7/20
to TiddlyWiki
As I play around to get my bare bones "task management" jussst right...

I like the idea of a category of things to do reminder to show up only if there are actually one or more things that need to be done in that category.

BTW: when I've got a tiddler that needs a little tweaking to be done later, I create a reminder by slapping a "TODO" link wherever is handy in the tiddler that needs tweaking.

So I took a little fun side journey to show  a details widget for "TODO" items only if there are 1 or more backlinks to the TODO tiddler.

While I was at it, I took another little fun side journey to set the "title" (or "summary" property) of the details widget so that it shows the count of backlinks to the TODO tiddler.

Filtering operations and results in the screenshot further below.

(Admittedly, I was not crazy for all of this filtering business for the longest time.  Now, I'm finding myself having a lot of fun with it.  I think it is because I like the "series of transformations",  tweak upon tweak upon tweak as I iterate towards a final result, very similar to how I like doing "select from a select from a select" when I build Oracle SQL statements.)

Cheers !


Screenshot 2020-12-07 at 8.35.09 PM.png

TW Tones

unread,
Dec 7, 2020, 10:01:33 PM12/7/20
to TiddlyWiki
Charlie,

Yup, filters are fun. Also placing content inside the details summary, can be done with vanilla HTML as well. It is a nice place to put content summarising the content in the drop down, but you can also get checkboxes and buttons in there as well, I discovered recently.

Tones

Charlie Veniot

unread,
Dec 9, 2020, 9:13:56 PM12/9/20
to TiddlyWiki
The following in my online project for anybody who wants to go play:  ORM-ish à la TiddlyWiki

G'day,

My task management needs in ORM-ish à la TiddlyWiki are very basic:
  • ListWidget of backlinks to a "TODO" tiddler
    • When there's something in some tiddler I want to address later, I just add a "TODO" link and, maybe, a note of what I want to do
  • A bit more involved: a ListWidget with fairly detailed info about work I started but did not take all of the way (i.e. still have "default" values in the related tiddlers, default values automagically added via custom tiddler creation buttons/macros
In my first post, I had only modified a Tasks tiddler to hide the TODO section if there are no TODO's (show the section if there are TODO's), and show a count of TODO's in the title of the related Details widget.

Now I've also done the same thing for two other sections in my Tasks tiddler to show/hide the sections and show a count of things to be done for each section, again showing in the titles of the related Details widgets.

Wee screenshot and related code further below.

Cheers !

Screenshot 2020-12-09 at 9.55.32 PM.png

<!-- 🔴 TODO -->
<$list filter="[[TODO]backlinks[]count[]] +[!match[0]]">

<$details summary={{{ [[General TODO Items]]  [[TODO]backlinks[]count[]] +[join[ ➡ ]] }}}>

{{TODO}}
</$details>

</$list>

<!-- 🔴 FACTS -->

<$vars vc1="{{Data##fc1}}"  vc2="{{Data##fc2}}"  vc3="{{Data##fc3}}">

<$vars count={{{[tag[fact]field:c1<vc1>] [tag[fact]field:c2<vc2>] [tag[fact]field:c3<vc3>] [tag[fact]!has[c1]] [tag[fact]!has[c2]] [tag[fact]!has[c3]] +[count[]]}}}>

<$list filter="[<count>] +[!match[0]]">

<$details summary={{{ [[Facts - Incomplete Coded Form]]  [<count>] +[join[ ➡ ]] }}}>

{{Facts - Incomplete Coded Form}}
</$details>

</$list>

</$vars>

</$vars>

<!-- 🔴 ENTITIES -->

<$vars vpk="{{Data##epk}}">

<$vars count={{{[tag[entity]field:pk<vpk>] [tag[entity]!has[pk]] +[count[]]}}}>

<$list filter="[<count>] +[!match[0]]">

<$details summary={{{ [[Entities - Incomplete Primary Key]]  [<count>] +[join[ ➡ ]] }}}>

{{Entities - Incomplete Primary Key}}
</$details>

</$list>

</$vars>

</$vars>
Reply all
Reply to author
Forward
0 new messages