[tw5] Re: Automatic display of field content toggled by tag

2022-09-01 Thread PMario
By the way. 
Most of the discussion is going on at: https://talk.tiddlywiki.org/ now. 
... Just to let you know. 
-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/74c3e310-9670-4d29-b620-3575b88ee79fn%40googlegroups.com.


[tw5] Re: Automatic display of field content toggled by tag

2022-09-01 Thread PMario
On Thursday, September 1, 2022 at 10:24:26 AM UTC+2 ma...@oliverhahn.net 
wrote:
..

> May I just add one remark to a small weakness of your code, just in case 
> some other person would like to use that feature. 
>

That was intentional, to test your participation :)) ... 


... just joking 
 

> 
> I solved that with adding another complementary list filter in 
> :/my/tabs/header/template. The template now looks like:
>
> ```
> <$list filter="[tag[info]]">
> <$tiddler tiddler=<> >
> <$transclude tiddler=":/my/body/header/template" mode="block"/>
> 
> 
> <$list filter="[!tag[info]]">
> <$tiddler tiddler=<> >
> <$transclude tiddler="$:/core/ui/ViewTemplate/body/default" mode="block"/>
> 
> 
> ```
>

There would be a different way with a more complex filter construction. But 
I think "keep it simple .." wins here. It's probably more flexible in the 
future. 

well done ;)
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/1ec86c99-c870-4fce-b506-b77d6c508f15n%40googlegroups.com.


[tw5] Re: Automatic display of field content toggled by tag

2022-09-01 Thread ma...@oliverhahn.net
Hello PMario!

Thank you so very much for your solution! It's wonderful and fits now 
exactly the belongings of my organisation. I am very taken with your 
dedication and patience. And thanks especially for that 
$:/tags/ViewTemplateBodyFilter trick I didn't know before, it's that cool 
way I was looking for. 

May I just add one remark to a small weakness of your code, just in case 
some other person would like to use that feature. 

The list filter in :/my/tabs/header/template works only if the tag info is 
set. That leads to the effect that a tiddler without the info tag is not 
displayed in tab view at all. You can check that in your example with 
removing the info tag from the SampleTabOne tiddler and watching the result 
in test-tabs tiddler. I solved that with adding another complementary list 
filter in :/my/tabs/header/template. The template now looks like:

```
<$list filter="[tag[info]]">
<$tiddler tiddler=<> >
<$transclude tiddler=":/my/body/header/template" mode="block"/>


<$list filter="[!tag[info]]">
<$tiddler tiddler=<> >
<$transclude tiddler="$:/core/ui/ViewTemplate/body/default" mode="block"/>


```

So our demand is solved, thanks again for your help.

Greetings!

Oliver


PMario schrieb am Mittwoch, 31. August 2022 um 22:22:56 UTC+2:

> Your request is OK. I think I could figure it out ;) 
>
> General rule: 
>
> Please describe the requested result in plain text or create some 
> screenshots with normal wikitext, but without the templates ... Sometimes 
> it's possible to create a "mockup" with standard wikitext 
>
> If we only get broken code or code that doesn't do what you want, it's 
> very hard for us to imagine, what you wanted, with code alone. The plain 
> text helps much more. .. 
>
> On Wednesday, August 31, 2022 at 4:05:09 PM UTC+2 ma...@oliverhahn.net 
> wrote:
> ...
>
>> 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:
>>
>
> It shouldn't be needed to manipulate the ViewTemplate. .. There are 
> several mechanisms in place that allow us to avoid that. 
>
> My response below addresses the following paragraph only. 
>
> >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. 
>
> My very first solution used the ViewTemplate cascade, but it only worked 
> with the tiddler and not with tabs. 
> Infos of the active cascade can be found at: 
>
> ControlPanel -> Info -> Advanced 
> -> Cascades -> View Template Body ... tab
>
> I assume you want something like this: 
>
> [image: body-header.png]
>
> There are 3 template elements needed. ... 
>
> *1st tiddler:*
>
> Title -> `:/config/enable/body/header` tagged: `$:/
> tags/ViewTemplateBodyFilter` ... 
> It's responsible to enable the header in the standard tiddler body. .. As 
> the name suggests ;) The ViewTemplate is dynamically configured. 
>
> *Important:* It needs a `list-before` field with the value 
> `$:/config/ViewTemplateBodyFilters/default`
>
> The content is a filter expression, that needs to return the name of the 
> body-template. I used `:/my/body/header/template` here in the example. If 
> you use it like this it's a standard tiddler. But if you add a $ as the 
> first character, it will be system tiddler and will not show up for your 
> users. 
>
> System tiddlers can be found in the right sidebar -> More -> System .. or 
> with AdvancedSearch -> System tab
>
> ```
> title: :/config/enable/body/header 
> tags: $:/tags/ViewTemplateBodyFilter 
> list-before: $:/config/ViewTemplateBodyFilters/default
>
> [all[current]tag[info]then[:/my/body/header/template]] 
> ```
>
> *2nd tiddler: *
> `:/my/body/header/template` ... Which contains the new header code
>
> ```
> ''Revisionsstand:<$view field="Stand" format="date" template="MMM 
> "/>''
> 
> {{||$:/core/ui/ViewTemplate/body/default}}
> ```
>
> *3rd tiddler: *
> `info-tab-template` ... I did rename this one. In the finished product it 
> may be `$:/my/tabs/header/template`
> It got new code, so we can reuse the body-header-template .. so changes 
> are only needed in 1 place. 
>
> ```
> <$list filter="[tag[info]]">
> <$tiddler tiddler=<> >
> <$transclude tiddler=":/my/body/header/template" mode="block"/>
> 
> 
> ```
>
> As I wrote if your users shouldn't see that stuff, you need to make them 
> system tiddlers. They start with `$:/` ... The tiddler titles have to be 
> manually *adjusted in the code too*. 
>
> There is a ZIP file attached, that I used for testing. 
>
> 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