Discussion:
[tw5] toc-selective-expandable with more than one search criteria
'Martin Petersen' via TiddlyWiki
2018-12-04 16:38:39 UTC
Good evening, I am just starting to explore this wonderful piece of
ingenuity so bear with me when I ask a silly question:

toc-selective-expandable command I can search for one tag but I fail to
combine two or more. Letâs say I have Tiddlys with the tag Company and some
of them have Text as another tag and some others have the tag Numbers (but
not the tag Text) and I would like to list only those Tiddlys with a
combination of the tags Company and Numbers (excluding those with the tag
Text). How do I do this and where is this documented?
--
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 post to this group, send email to ***@googlegroups.com.
'Mark S.' via TiddlyWiki
2018-12-04 19:54:10 UTC
Everybody loves the TOC macros ... and then immediately wants to change
them ! ;-)

Something like this comes up so often, there should probably be a comment
in the TOC documentation.

A partial solution is to use the "sort" parameter. You can make a sort
parameter perhaps like:

sort:"!tag[Text]"

The problem, if I recall correctly, is that the TOC macro will still create
branches, even if the branch has no "leaves". Still, it's a start.

Good luck!
-- Mark
Post by 'Martin Petersen' via TiddlyWiki
Good evening, I am just starting to explore this wonderful piece of
toc-selective-expandable command I can search for one tag but I fail to
combine two or more. Letâs say I have Tiddlys with the tag Company and some
of them have Text as another tag and some others have the tag Numbers (but
not the tag Text) and I would like to list only those Tiddlys with a
combination of the tags Company and Numbers (excluding those with the tag
Text). How do I do this and where is this documented?
--
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 post to this group, send email to ***@googlegroups.com.
TonyM
2018-12-04 23:54:32 UTC
Martin,

On tiddlywiki.com for toc selective expandable we see

<div class="tc-table-of-contents">
<<toc-expandable "Contents">>
</div>

That is it calls the macro toc-expandable

$:/core/macros/toc Which on editing we see the definition \define toc-expandable(tag,sort:"",itemClassFilter:" ",exclude,path) <$vars tag="""$tag$""" sort="""$sort$""" itemClassFilter=
"""$itemClassFilter$""" excluded="""$exclude$ -[[$tag$]]""" path=
"""$path$/$tag$""">
<ol class="tc-toc toc-expandable">
<$list filter="""[all[shadows+tiddlers]tag[$tag$]!has[draft.of]$sort$] -[[$tag$]]$exclude$"""> <$list filter="[all[current]toc-link[no]]" emptyMessage=<<toc-
expandable-empty-message>> >
<$macrocall$name="toc-unlinked-expandable-body" tag="""$tag$"""
sort="""$sort$""" itemClassFilter="""itemClassFilter""" exclude=<<excluded>>
path=<<path>> />
</$list> </$list>
</ol>
</\$vars>
\end

If you look in the define line you can see mention of parameter that appear
not fully documented. and exclude is simply added to the end of the filter.

Perhaps trying providing your own exclude parameter, perhaps even to
include something +[[tag]]

But I ask do you really want a TOC macro here, because the TOC requires
each tiddler be tagged with a tiddler higher up in the tree, and eventually
the root tiddler, is this still true when you try and exclude one of your
tags?

Regards
Tony
Post by 'Martin Petersen' via TiddlyWiki
Good evening, I am just starting to explore this wonderful piece of
toc-selective-expandable command I can search for one tag but I fail to
combine two or more. Letâs say I have Tiddlys with the tag Company and some
of them have Text as another tag and some others have the tag Numbers (but
not the tag Text) and I would like to list only those Tiddlys with a
combination of the tags Company and Numbers (excluding those with the tag
Text). How do I do this and where is this documented?
--
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 post to this group, send email to ***@googlegroups.com.
'Martin Petersen' via TiddlyWiki
2018-12-05 13:00:04 UTC
Tony and Mark, thanks so much for your replies. I think I will have to dive
deeper into tagging in TW as it seems to work not as I expected it to do.

Best regards

Martin
--
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 post to this group, send email to ***@googlegroups.com.
bimlas
2018-12-05 13:55:47 UTC
Martin,

I do not quite understand what you want to achieve: filtering through

If this is the first option, maybe this plugin can help:
https://bimlas.gitlab.io/#Filter%20by%20multiple%20tags%20easily%3A%20FilteredTag%20example

I work on other solutions to make tags really useful, but all of them are
still in development. For example, type in the search box: "wiki #macro" -
it will list the related tags that you can apply for the search. Another
way to find tag on the Contents sidebar: Press >> next to the items to
the top of the sidebar - I would like to use the kin filter
(https://bimlas.gitlab.io/demo/tw5/kin-filter.html) on listing, so that
only those elements that are in the given context will appear.

Again I signal that *these are under development, do not use it in your own
wiki*.
--
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 post to this group, send email to ***@googlegroups.com.
bimlas
2018-12-06 14:41:14 UTC