Hi Oliver,

On Monday, August 29, 2022 at 3:07:21 PM UTC+2 ma...@oliverhahn.net wrote:

> ... This is not ideal, it really should be toggleable (by tag) and my 
> solution works only in the tiddler default view. But we are making 
> extensive use of the tabs macro in our Tiddlywiki and unfortunately the 
> ViewTemplate-solution doesn't work on tabs. 
>

So I do understand you right, that you want the info-field, to be shown 
inside the tabs macro above the tiddler content. right?

The tabs-macro allows you to use a template 
<https://tiddlywiki.com/#tabs%20Macro>. So it can be called as follows. See 
the new "template" parameter

```
<<tabs "SampleTabOne SampleTabTwo SampleTabThree SampleTabFour" 
"SampleTabOne" "$:/state/tab1" template:"info-tiddler-template">>
```

Create a new tiddler eg:  *info-tiddler-template* with the following 
content: do *not* use the 3 backticks ```  ... only the text between them.

```
\whitespace trim

<$list filter="[<currentTab>tag[info]">
<$transclude tiddler=<<currentTab>> field="info" />
</$list>

<$tiddler tiddler=<<currentTab>> >
<$transclude tiddler="$:/core/ui/ViewTemplate/body/default" mode="block"/>
</$tiddler>
```

Where the list-widget checks if the tiddler mentioned in the 
currenTab-variable has a tag "info". If yes it shows that info using the 
transclude-widget. 

The second code block uses the default core template, that is used for the 
tiddler body. 

I did test it at tiddlywiki.com .. If it doesn't work for you just ask. 

The following code adds a HTML HR .. horizontal rule, so there is a visual 
indication that the info field is shown. .. That's just an example, so you 
see, where you can add additional conditional info text

```
\whitespace trim

<$list filter="[<currentTab>tag[info]">
<$transclude tiddler=<<currentTab>> field="info" />
<hr>
</$list>

<$tiddler tiddler=<<currentTab>> >
<$transclude tiddler="$:/core/ui/ViewTemplate/body/default" mode="block"/>
</$tiddler>
```

have fun!
mario

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/e024fb9b-1d77-4894-93ae-80f6dba3bd9bn%40googlegroups.com.

Reply via email to