Mat,

Thanks for the feedback

I assume you read the content of 
$:/PSaT/button-reveals? 
<file:///C:/Data/TW5/Development/Scratch2.html#%24%3A%2FPSaT%2Fbutton-reveals>
 
Note: *Using variable=nul in a list widget* is a reliable way of using a 
list widget to selectively display content. If you do not need or want the 
current tiddler to change or be lost inside a widget defining 
"variable=variablename" changes <<variablename>> not <<currentTiddler>> 
according to the filter, this leaves you free to reference the original 
current tiddler and use shortcuts like {{!!fielname}} or {{!!title}}

If however the list filters only purpose is to display something when the 
filter is true, then I name the variable nul so it is clear to me I will 
not be accessing the actual result of the filter, only the fact it is true.


> 2) I get a false positive in
>
> <$list filter="[{$:/config/button-buttonname-state}] -[[false]]" 
> variable=nul>
> Show when true
> </$list>
>
> i.e "Show when true" shows without having clicked the button. I suspect 
> the filter leaves "remaints" when the state tiddler doesn't exist, like 
> empty brackets, so it becomes "[] -[[false]]" which is not empty. Try this 
> for example: <$list filter="[{doesntexist}]">xxx</$list> [Edit: reported 
> issue <https://github.com/Jermolene/TiddlyWiki5/issues/4018>]
>

Opps, these are not dealing well with a empty state field/tiddler. I will 
check and update. They need to be rewritten to account for the non existent 
state field or tiddler. Another reason to use the ID= method. This is 
unlikely to happen with a global state because it will not happen after the 
first use.
 

>
> 3) For the reveal, are you saying the user should manually type in one (or 
> even several?) of those listwidgets/revealwidgets? 
>

Actually this was designed to be used any way you choose. Personally I 
think this method is the best AND THE ONLY NECESSARY, such is the way we 
can define the area which we wish to toggle into view

<<toggle-here local-show>>

<section id=local-show-true>
I am on true 
</section>

<div id=local-show-true>
I am on true 
</div>
But you could use it on div span etc...

This has the advantage that the default will be honored even if the state 
tiddler and field do not exist.

By the way when testing did you not have a button with a more original name 
than buttonname ?


When I say one (or even several?) of those listwidgets/revealwidgets?


Use one Only if you want, or as many as you want. If you only want to display 
one thing in one condition go ahead. But you could;

Have multiple places in a tiddler respond to this state

Buttons on the view template, page template, above store, sidebar etc... can 
all respond to the toggle state.



To name one thing, how is the user supposed to remember the string 
> "$:/config/button-buttonname-state"? I'd suggest packing this into a 
> macro as well. (And what's with the unused nul variable?)


You need only remember "buttonname" the name you used, if you use the HTML 
id. and then add either -true or -false at the end. if you wish to use a 
state tiddler for a global state it will always be 
$:/config/button-buttonname-state (replace buttonname with your chosen 
toggle button name(s).
 


4) Before it is released, may I humbly propose that you make the code more 
> dry <https://en.wikipedia.org/wiki/Don%27t_repeat_yourself>, i.e that you 
> move the identical parts of the macros to a single macro and have the call 
> to it define if it is "here" or "global". Currently, it is a pretty big 
> code for a small thing. By doing this you could also use, say, the "here" 
> version as a default so that the user can use "<<toggle Foo>>" or 
> "<<toggle-global Foo>>".
>

Your humble suggestions will be taken into account. But I wanted to test 
the resulting functionality first. Not that it is very big anyway, yes I 
could almost halve it, but it will be less easy to understand.
 

>
> This could really be something useful!
>

Thanks, I hope so for others, because I think it will be important to me. 


> <:-)
>

On reflection I can see that something similar could be done for a range of 
items beyond a toggle/reveal combination, I am thinking of check boxes, 
Detail reveals, multiple values select dropdowns etc... What interests me 
is finding a simple way to have interactive documents in which you make 
choices and different information reveals itself.

Regards
Tony

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/tiddlywikidev.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywikidev/10e90533-922e-4840-833c-11d95704d959%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to