Hello mario, hello everybody!

Mario, thank you very much for your detailed answer. I was able to transfer 
your solution to my testing wiki and it works principally and I understand 
the way it works. 
Unfortunately my indended field is in date format. The output of the 
described tiddler-template-solution is as an unformatted string like 
20220829. I could not find a way to enter working format parameters in the 
transclude line in the template. Do you perhaps have an idea how to format 
the output to a readable date?

But after all this solution does sadly not address my whole problem. With 
this tabs-template-solution the definded field content of a tiddler is 
shown in tabs view, but not in the standard tiddler view. I was looking for 
a solution which shows the field content in both views. 

What I found so far is:

1. Manipulating $:/core/ui/ViewTemplate
When I insert a $view field command in the $:/core/ui/ViewTemplate my field 
content is shown - if existing - at the top of any tiddler in standard 
view. Date formatting is possible, but I was not able to make this 
tag-sensitive. It is not seen in tab view. I am aware that manipulating the 
common ViewTemplate is a quite brutal way. 
Part of my $:/core/ui/ViewTemplate:

```
[<currentTiddler>is[shadow]is[tiddler]then[tc-tiddler-overridden-shadow]] 
[<currentTiddler>is[system]then[tc-tiddler-system]] [{!!class}] 
[<currentTiddler>tags[]encodeuricomponent[]addprefix[tc-tagged-]] +[join[ 
]] }}}>
''Revisionsstand:&nbsp;<$view field="Stand" format="date" template="MMM 
YYYY"/>''
<hr>
<$list 
filter="[all[shadows+tiddlers]tag[$:/tags/ViewTemplate]!has[draft.of]]" 
variable="listItem">
<$transclude tiddler=<<listItem>>/>
```

2. Manipulating $:/core/macros/tabs
I inserted a $view tiddler line in $:/core/macros/tabs and my field content 
is shown in tabs view. Again, date formatting works but I clould not make 
it tag-sensitive. 
Part of my $:/core/macros/tabs:

```
<$reveal type="match" state=<<tabsState>> text=<<currentTab>> 
default="$default$" retain="""$retain$""">
<$transclude tiddler="$template$" mode="block">
''Revisionsstand:&nbsp;<$view tiddler=<<currentTab>> field="Stand" 
format="date" template="MMM YYYY"/>''
<hr>
<$transclude tiddler=<<currentTab>> mode="block"/>
</$transclude>
```

3. CSS
I was trying to enter some content via Tiddlywiki's CSS interface, like so:

```
.tc-tagged-info:before {
    content: "TEST";
}
```

This works with text, but entering html via 'content' seems to be not 
possible by design. Dead end again. 

So, a bunch of questions are still open: 
A. Is there a more elegant way to set up my plan of date field content 
beeing displayed in a tagged tiddler in both, the standard and the tab view?
B. If it has to be a deep manipulation, is it possible to manipulate 
Tiddlywiki on a single point, so that a date field content is displayed in 
a tagged tiddler in both, the standard and the tab view?
C. If it have to be the both points which I described in 1. and 2., can 
these be made tag-sensitive?

Thanks for your patience
Greetings

Oliver Hahn


PMario schrieb am Dienstag, 30. August 2022 um 14:50:08 UTC+2:

> 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/7848f24f-dc3c-42fe-afc7-65a80a9ffecen%40googlegroups.com.

Reply via email to