Creating similar tabs sections for individual tiddlers

148 views
Skip to first unread message

Fabian Losch

unread,
Jul 14, 2019, 1:42:47 PM7/14/19
to TiddlyWiki
Dear all,

I try to set up a tiddly wiki for law. What I am trying to achieve is this:

For each tiddler, I want a tab section called Verständnisfragen, Grenzfragen and Beispiele (understanding/comprehension, boundary questions and examples tab), which I can fill with content.
Each tab shall depict typical questions on what is the idea of the respective idea, where are limits and what would be typical expamples and the corresponding answers. This would be the typical layout for many different tiddlers, lets say e.g. a tiddler for posession and a tiddler for ownership, each one of these tiddlers having these tabs.

I am aware, that I can create correspondet tiddlers and link them into tabs via the exact name space. However, I assume there is a more elegant way to include these tiddlers via transclusion, as each tab has a tag of the correspondent mother tiddler.


My question is now: How do I create "dynamic" links (or filters) for tabs, that link to all tiddlers that have the same tag as the respecitve tiddler name. Can you follow me on this?
An example would be a tiddler called "Sonderrechtstheorie" and three more tiddlers tagged "Sonderrechtstheorie" also having one of the following tags "Verständnisfragen", "Grenzfragen" and "Beispiele", which I want to transclude as individual tabs in the mother tiddler "Sonderrechtstheorie".

How do I do that? I can't get my mind around the filter notations ( <<tabs [tag["mothertiddler] AND  [tag[Verständnisfragen] OR [Grenzfragen OR [Beispiele]] >>)
I would appreciate any helpful hints!

My ever-lasting gratitude for whoever might help me out here!

Yours
Fabian

Tabs.png

Mat

unread,
Jul 14, 2019, 2:03:16 PM7/14/19
to TiddlyWiki
An example would be a tiddler called "Sonderrechtstheorie" and three more tiddlers tagged "Sonderrechtstheorie" also having one of the following tags "Verständnisfragen", "Grenzfragen" and "Beispiele", 

Are you saying the listed tab tiddlers should all have the tag Sonderrechtstheorie and optionally, but not necessarily, any of the other three? (In that case it should be enough with only tag Sonderrechtstheorie.) Or necessarily ANY of the other three (easy)? Or necessarily ONLY one of the other three (harder)?

<:-)

Ste Wilson

unread,
Jul 14, 2019, 2:21:57 PM7/14/19
to TiddlyWiki

Fabian Losch

unread,
Jul 14, 2019, 2:29:30 PM7/14/19
to TiddlyWiki
Dear Mat,

in my laymen's view it seems sufficient, that the tab tiddlers have only one additional tag besides the mother tiddlers title, i.e. "Verständnisfragen", "Grenzfragen" or "Beispiele".
However, if you have any suggstions on how to solve the problem in a more adavanced way, i am very open on how this could work.

The idea is to present the reader a general introduction within the "mother tiddler", and then referring him to more detailed aspects when selecting one of the tabs. General idea is to enable the reader to check-proof himself on the underlying concpets of each tiddler (e.g. what's the concept of possession seen against the concept of property, what are typical use cases(use cases and examples), and where do these concepts are  prone to fail (Grenzfragen). Hopefully, this answers your question? If not, give me a hint on where I should make myself more clear....

Thanks for having a look into it. Appreciating your help !

Fabian Losch

unread,
Jul 14, 2019, 2:34:01 PM7/14/19
to TiddlyWiki
Dear Wilson,

your suggested solution seems to be a nice add-on in respects to a visual representation, but as far as i can see, it's (at the moment beeing) beyond the scope i want to achieve. Thanks anyway, might be useful in further development of my project. Thumps up for your suggestion :)

Fabian Losch

unread,
Jul 14, 2019, 2:34:35 PM7/14/19
to TiddlyWiki

Mat

unread,
Jul 14, 2019, 2:58:45 PM7/14/19
to TiddlyWiki
Wait, judging from your image, you're talking about the content of the tabs not the tabs themselves. Is that right?

<:-)

TonyM

unread,
Jul 15, 2019, 1:16:26 AM7/15/19
to TiddlyWiki
Fabian,

The Edit tabs plugin mentioned by mario in this discussion recently will get you a long way.

Without going into too much detail I will soon publish some macos to help with this very issue.

I call these compound tiddlers and I am very close to being able to package a full set of support plugins and macros for this.

Regards
tony

TonyM

unread,
Jul 15, 2019, 2:35:42 AM7/15/19
to TiddlyWiki
Fabian,

I discovered a Quick Solution

In a tiddler tagged $:/tags/Macro

past the following
\define tabsetname() [[$(currentTiddler)$-overview]] [[$(currentTiddler)$-details]]  [[?]]
\define show-tabset(tabsetname)
<$set name=tabs-in value=<<$tabsetname$>> >
<$set name=state value=<<qualify $:/temp/tabset-here-state>> >
<$macrocall $name=tabs tabsList=<<tabs-in>> state=<<state>> />
</
$set></$set>
<hr>
\end

To test the default place this in any tiddler
<<show-tabset tabsetname>>

Notes
  • Note how the definition of tabsetname uses $(currentTiddler)$ as a prefix for the tab. This makes the tab unique to this tiddler.
  • In the case of the tab called [[?]] it will be the same every time you use that tabset, or if it is also in another tabset
  • With Marios edit-tabs or Link-to-tabs plugin you can click on the link icon that appears and edit or create the tiddler in the tab
  • In each tab tiddler you can add a caption field and its contents will become the tabname.
To create your own tabset copy the line
\define tabsetname() [[$(currentTiddler)$-overview]] [[$(currentTiddler)$-details]]  [[?]]

 and rename and edit it

\define mytabsetname() [[$(currentTiddler)$-readme]] [[$(currentTiddler)$-notes]]  [[Guidelines]]


Then in any tiddler
<<show-tabset mytabsetname>>

Or you could display this via the view template, eg in a tiddler tagged $:/tags/ViewTemplate
<$list filter="[is[current]object-type[project]" variable=null>
   <
<show-tabset mytabsetname>>
</$list>

An this will conditionally show the tabs on all tiddlers with a field object-type containing the value project

Using additional code in the above view template you could offer to create the missing tab tiddlers from a template and other snazzy things.

Regards
Tony





On Monday, July 15, 2019 at 3:42:47 AM UTC+10, Fabian Losch wrote:

Fabian Losch

unread,
Jul 15, 2019, 4:03:36 PM7/15/19
to TiddlyWiki
Terrific!
This hits and solves the very core of my problem.

I bow in awe.

Thank you!
Fabian

TonyM

unread,
Jul 15, 2019, 5:15:40 PM7/15/19
to TiddlyWiki
Fabian

Your welcome. No promises but I am slowly transforming this into a compound tiddlers tool that creates the tab tiddlers on demand

Regards
Tony

pedruchini

unread,
Jul 15, 2019, 8:05:52 PM7/15/19
to TiddlyWiki
Tony,

In the tabs macro, for example

<<tabs "[[Tab One]] [[TabTwo]] [[TabThree]] [[TabFour]]" "[[Tab One]]" "$:/state/tab1">>

Tab One is selected by default.

What shoud I add to your macro to achieve the same result?

(I'm just an end user with almost non-existent programming skills.)

Thanks

TonyM

unread,
Jul 15, 2019, 8:57:14 PM7/15/19
to TiddlyWiki
pedruchini,

I intentionally did not bother dealing with the default tab because when using the state it will only happen once
and from that point onwards it will use the last selected tab. 

Also when someone sees a list of tabs I try and make the names (Using caption) be the guide, not the default. 
Eg my First tab may be "Overview" or the last tab [[?]] which opens the same tiddler everytime ? 

You could hack my macro to accept another parameter, and if is was important and beyond your skills I could do it for you.

Regards
Tony

pedruchini

unread,
Jul 16, 2019, 3:30:37 PM7/16/19
to TiddlyWiki
Tony,

Here is my use case (simplified). I'm teaching a foreign language and...

for the tiddler 'Adverbs' I would like to have three tabs:

Beginners - Intermediate - advanced

Now, since the students who are consulting this tiddlywiki are at intermediates's level I would like the tab 'intermediate' be selected by default.

The other two tabs allow these students to brush up on their beginners level o to extend their knowledge to the advanced level, but the main tab should be  'Intermediate'. That's why it would be nice to have a tab selected by default.
As for states, in the tiddler '$:/core/ui/ViewTemplate/title' I added this: 

<$action-deletetiddler $filter="[prefix[$:/state/]]"

to clear all states (in fact I created a second 'close botton' to 'close and clear all states').

Therefore, it won't use the last selected tab, but the default tab.

Pedro

TonyM

unread,
Jul 16, 2019, 8:43:54 PM7/16/19
to TiddlyWiki
Pedro,

You will notice in the macro I provided show-tabset I set the state field as 
<$set name=state value=<<qualify $:/temp/tabset-here-state>> >
This makes a state tiddler unique for each Tiddler

I think you may still make use of saving the state, if an intermediate user opens the advanced tab let it remain so when they return.

However if you have a tiddler somewhere containing the current users "level" eg $:/config/studentlevel you can make a new macro (recommended) or change mine such that the line

<$macrocall $name=tabs tabsList=<<tabs-in>> state=<<state>> />

Sets the default here
<$macrocall $name=tabs tabsList=<<tabs-in>> state=<<state>> default=<<default-tab>> />

Now we need to define the default-tab macro
\define default-tab() [[$(currentTiddler)$-{{$:/config/studentlevel}}]]


Then until the user changes the tab, the tab with the title in $:/config/studentlevel
<<default-tab>>
will display first.

Caveats
  • I have not tested the above code
  • It depends on your consistently naming tabs etc... careful with case except in the caption field(s)
Regards
Tony

pedruchini

unread,
Jul 17, 2019, 3:44:07 PM7/17/19
to TiddlyWiki


Thank you, Tony.
I will experiment with that code in the next few days.

Pedro
Reply all
Reply to author
Forward
0 new messages