How to add group for untagged tiddlers to table of contents?

191 views
Skip to first unread message

MaxGyver

unread,
Nov 3, 2019, 8:47:55 AM11/3/19
to TiddlyWiki
Hi all,

I'm using a contents tab in the sidebar:

<div class="tc-table-of-contents">
<
<toc-selective-expandable 'Contents' "sort[title]">>
</div>

This gives me an expandable table of contents like that:

> Tag1
> Tag2
> Tag3

How can I add a group for all tiddlers without a tag?

As a workaround, I have added a filter:

<div class="tc-table-of-contents">
<
<toc-selective-expandable 'Contents' "sort[title]">>
</div>
!!! Others:
<$list filter="[!is[system]!tag[Tag1]!tag[Tag2]!tag[Tag3]]">

This gives me:

> Tag1
> Tag2
> Tag3

Others:

Tiddler1
Tiddler2
...

That way the untagged tiddlers are not in a expandable group and I have to update the filter everytime I add a new tag.

Is there a cleaner solution?

Best regards
Max

Sycom

unread,
Nov 3, 2019, 5:29:48 PM11/3/19
to TiddlyWiki
Hi

Maybe [... !has[tags]] ?

Cheers

Sylvain
@sycom

Jeremy Ruston

unread,
Nov 3, 2019, 5:32:07 PM11/3/19
to TiddlyWiki
Hi Max, Sylvain,

There is an untagged[] operator that returns all tiddlers that don’t have a tag:


Best wishes

Jeremy

--
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+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/5e8f3e79-e6c1-4064-9ca0-3f17a05c3a09%40googlegroups.com.

TonyM

unread,
Nov 3, 2019, 5:37:13 PM11/3/19
to TiddlyWiki
To clarify

You are after a list of tiddlers not tagged with a specific set of tags, rather than tagless tiddlers?

then you wish to automate the addition of tags to the specific set of tags without editing wiki text?

first I would start with a tag of tags E.g.: "tag group" and tag your specific set of tags. Add-on another specific tag by tagging it with the "tag group"

This is not the full solution (I'm on my mobile) but consider the use of the subfilter operator.

Regards
Tony

MaxGyver

unread,
Nov 4, 2019, 4:15:31 PM11/4/19
to TiddlyWiki
Thanks for your answers!
 
You are after a list of tiddlers not tagged with a specific set of tags, rather than tagless tiddlers?

I want all tagless tiddlers because the table of contents only lists all my tagged tiddlers.

So a filter like !has[tags] or untagged[] seems to be fine.

I would expect that these three filters return the same tiddlers (because I only use three different tags so far):
  1. <$list filter="[!is[system]!has[tags]]">
  1. <$list filter="[!is[system]!tag[Tag1]!tag[Tag2]!tag[Tag3]]">
  1. <$list filter="[!is[system] untagged[]]">
But I get 12 vs. 45 vs. 77 tiddlers. I'll have a look into what the tiddlers missing in list 1 and in list 2 have in common.

And does anybody know how I get my filter into a foldable group like the tag groups in the table of contents?

Best regards,
Max

Sylvain Comte

unread,
Nov 4, 2019, 5:07:31 PM11/4/19
to tiddl...@googlegroups.com
Hello,

By the way 

* !has[tags] was not a good way to proceed. Only tiddlers WITHOUT a tags field will be listed. i.e. handcoded tiddlers since tw created ones always have a tags field,
* untagged[] is a better way and will give you also tiddlers with empty tags field,
* not sure about what !tag[Tag1]!tag[Tag2]!tag[Tag3] does differently in your case but I'd be interested by your investigations (system tags?)

Cheers

Sylvain
@sycom

--
You received this message because you are subscribed to a topic in the Google Groups "TiddlyWiki" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tiddlywiki/6umMsegFhLI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tiddlywiki+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/3cbf08be-6fb8-4823-85fe-3d191b53ce07%40googlegroups.com.

Max Schillinger

unread,
Nov 6, 2019, 1:45:26 PM11/6/19
to tiddl...@googlegroups.com
Thanks for clarifying!

<$list filter="[!is[system] untagged[]]"> was wrong!
It must be <$list filter="[untagged[]!is[system]]"> instead.
That's very similar to <$list filter="[!is[system]!tag[Tag1]!tag[Tag2]!tag[Tag3]]">.

The latter is more complete. It contains the same tiddlers as the version with untagged[] plus all tiddlers tagged for example:
  • TableOfContents
  • $:/tags/RawMarkup
  • $:/tags/Stylesheet
  • $:/tags/SideBar
  • $:/tags/KeyboardShortcut
These are not included in the regular table of contents nor in the untagged group.

So I'm going to keep using <$list filter="[!is[system]!tag[Tag1]!tag[Tag2]!tag[Tag3]]">. I don't introduce new tags that often :-)

Mark S.

unread,
Nov 6, 2019, 2:32:56 PM11/6/19
to TiddlyWiki
A version that's somewhat easier to maintain, assuming your tags have no spaces or special characters:

<$list filter="[!is[system]] -[enlist[Tag1 Tag2 Tag3]tagging[]]" >

</$list>



On Wednesday, November 6, 2019 at 10:45:26 AM UTC-8, MaxGyver wrote:
Thanks for clarifying!

<$list filter="[!is[system] untagged[]]"> was wrong!
It must be <$list filter="[untagged[]!is[system]]"> instead.
That's very similar to <$list filter="[!is[system]!tag[Tag1]!tag[Tag2]!tag[Tag3]]">.

The latter is more complete. It contains the same tiddlers as the version with untagged[] plus all tiddlers tagged for example:
  • TableOfContents
  • $:/tags/RawMarkup
  • $:/tags/Stylesheet
  • $:/tags/SideBar
  • $:/tags/KeyboardShortcut
These are not included in the regular table of contents nor in the untagged group.

So I'm going to keep using <$list filter="[!is[system]!tag[Tag1]!tag[Tag2]!tag[Tag3]]">. I don't introduce new tags that often :-)

Am Mo., 4. Nov. 2019 um 23:07 Uhr schrieb Sylvain Comte <sylvai...@gmail.com>:
Hello,

By the way 

* !has[tags] was not a good way to proceed. Only tiddlers WITHOUT a tags field will be listed. i.e. handcoded tiddlers since tw created ones always have a tags field,
* untagged[] is a better way and will give you also tiddlers with empty tags field,
* not sure about what !tag[Tag1]!tag[Tag2]!tag[Tag3] does differently in your case but I'd be interested by your investigations (system tags?)

Cheers

Sylvain
@sycom

Le lun. 4 nov. 2019 à 22:15, MaxGyver <maximilian...@gmail.com> a écrit :
Thanks for your answers!
 
You are after a list of tiddlers not tagged with a specific set of tags, rather than tagless tiddlers?

I want all tagless tiddlers because the table of contents only lists all my tagged tiddlers.

So a filter like !has[tags] or untagged[] seems to be fine.

I would expect that these three filters return the same tiddlers (because I only use three different tags so far):
  1. <$list filter="[!is[system]!has[tags]]">
  2. <$list filter="[!is[system]!tag[Tag1]!tag[Tag2]!tag[Tag3]]">
  3. <$list filter="[!is[system] untagged[]]">
But I get 12 vs. 45 vs. 77 tiddlers. I'll have a look into what the tiddlers missing in list 1 and in list 2 have in common.

And does anybody know how I get my filter into a foldable group like the tag groups in the table of contents?

Best regards,
Max


Am Sonntag, 3. November 2019 23:37:13 UTC+1 schrieb TonyM:
To clarify

You are after a list of tiddlers not tagged with a specific set of tags, rather than tagless tiddlers?

then you wish to automate the addition of tags to the specific set of tags without editing wiki text?

first I would start with a tag of tags E.g.: "tag group" and tag your specific set of tags. Add-on another specific tag by tagging it with the "tag group"

This is not the full solution (I'm on my mobile) but consider the use of the subfilter operator.

Regards
Tony

--
You received this message because you are subscribed to a topic in the Google Groups "TiddlyWiki" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tiddlywiki/6umMsegFhLI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tiddl...@googlegroups.com.

--
You received this message because you are subscribed to a topic in the Google Groups "TiddlyWiki" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tiddlywiki/6umMsegFhLI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tiddl...@googlegroups.com.

TonyM

unread,
Nov 6, 2019, 11:41:09 PM11/6/19
to TiddlyWiki
Max,

Later you can look at grouping here https://tiddlywiki.com/#GroupedLists

Regards
Tony


On Thursday, November 7, 2019 at 5:45:26 AM UTC+11, MaxGyver wrote:
Thanks for clarifying!

<$list filter="[!is[system] untagged[]]"> was wrong!
It must be <$list filter="[untagged[]!is[system]]"> instead.
That's very similar to <$list filter="[!is[system]!tag[Tag1]!tag[Tag2]!tag[Tag3]]">.

The latter is more complete. It contains the same tiddlers as the version with untagged[] plus all tiddlers tagged for example:
  • TableOfContents
  • $:/tags/RawMarkup
  • $:/tags/Stylesheet
  • $:/tags/SideBar
  • $:/tags/KeyboardShortcut
These are not included in the regular table of contents nor in the untagged group.

So I'm going to keep using <$list filter="[!is[system]!tag[Tag1]!tag[Tag2]!tag[Tag3]]">. I don't introduce new tags that often :-)

Am Mo., 4. Nov. 2019 um 23:07 Uhr schrieb Sylvain Comte <sylvai...@gmail.com>:
Hello,

By the way 

* !has[tags] was not a good way to proceed. Only tiddlers WITHOUT a tags field will be listed. i.e. handcoded tiddlers since tw created ones always have a tags field,
* untagged[] is a better way and will give you also tiddlers with empty tags field,
* not sure about what !tag[Tag1]!tag[Tag2]!tag[Tag3] does differently in your case but I'd be interested by your investigations (system tags?)

Cheers

Sylvain
@sycom

Le lun. 4 nov. 2019 à 22:15, MaxGyver <maximilian...@gmail.com> a écrit :
Thanks for your answers!
 
You are after a list of tiddlers not tagged with a specific set of tags, rather than tagless tiddlers?

I want all tagless tiddlers because the table of contents only lists all my tagged tiddlers.

So a filter like !has[tags] or untagged[] seems to be fine.

I would expect that these three filters return the same tiddlers (because I only use three different tags so far):
  1. <$list filter="[!is[system]!has[tags]]">
  2. <$list filter="[!is[system]!tag[Tag1]!tag[Tag2]!tag[Tag3]]">
  3. <$list filter="[!is[system] untagged[]]">
But I get 12 vs. 45 vs. 77 tiddlers. I'll have a look into what the tiddlers missing in list 1 and in list 2 have in common.

And does anybody know how I get my filter into a foldable group like the tag groups in the table of contents?

Best regards,
Max


Am Sonntag, 3. November 2019 23:37:13 UTC+1 schrieb TonyM:
To clarify

You are after a list of tiddlers not tagged with a specific set of tags, rather than tagless tiddlers?

then you wish to automate the addition of tags to the specific set of tags without editing wiki text?

first I would start with a tag of tags E.g.: "tag group" and tag your specific set of tags. Add-on another specific tag by tagging it with the "tag group"

This is not the full solution (I'm on my mobile) but consider the use of the subfilter operator.

Regards
Tony

--
You received this message because you are subscribed to a topic in the Google Groups "TiddlyWiki" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tiddlywiki/6umMsegFhLI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tiddl...@googlegroups.com.

--
You received this message because you are subscribed to a topic in the Google Groups "TiddlyWiki" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tiddlywiki/6umMsegFhLI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tiddl...@googlegroups.com.

MaxGyver

unread,
Nov 7, 2019, 2:11:21 PM11/7/19
to TiddlyWiki
@Mark:
<$list filter="[!is[system]] -[enlist[Tag1 Tag2 Tag3]tagging[]]" >
Yes, that looks cleaner. Thanks.

@Tony:
Later you can look at grouping here https://tiddlywiki.com/#GroupedLists
This indents my list at least but it's still very different than the rest of the table of contents.

I suppose the cleanest solution would be to add a macro based on toc-selective-expandable.

\define toc-selective-expandable-include-untagged(tag,sort:"",itemClassFilter,exclude,path)
<$vars tag=<<__tag__>> sort=<<__sort__>> itemClassFilter=<<__itemClassFilter__>> path={{{ [<__path__>addsuffix[/]addsuffix<__tag__>] }}}>
  <$set name="excluded" filter="""[enlist<__exclude__>] [<__tag__>]""">
    <ol class="tc-toc toc-selective-expandable">
      <$list filter="""[all[shadows+tiddlers]tag<__tag__>!has[draft.of]$sort$] -[<__tag__>] -[enlist<__exclude__>]""">
        <$list filter="[all[current]toc-link[no]]" variable="ignore" emptyMessage=<<toc-selective-expandable-empty-message>> >
          <$macrocall $name="toc-unlinked-selective-expandable-body" tag=<<__tag__>> sort=<<__sort__>> itemClassFilter=<<__itemClassFilter__>> exclude=<<excluded>> path=<<path>>/
>
       
</$list>
      </
$list>
   
</ol>
  </
$set>
</$vars>
\end

<div class="tc-table-of-contents">
<<toc-selective-expandable-include-untagged 'Table of contents'  "sort[title]">>
</
div>

Maybe I can somehow add an untagged[]-filter to the list created in that macro. But it's like learning a new programming language :-(

Best regards,
Max
Reply all
Reply to author
Forward
0 new messages