<$button>Toggle</$button>
<$reveal>
Content
</$reveal>--
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 tiddlywikide...@googlegroups.com.
To post to this group, send email to tiddly...@googlegroups.com.
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/350ca438-2a71-46fb-80f9-08d271a125c2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
* It’s not backwards compatible. Right now there are lots of `<$button>` widgets without any attributes that use action widgets to do their stuff
* The proposed algorithm for autogenerating the state tiddler title isn’t robust enough to permit, say, two hide/show constructions within a single tiddler
An alternative approach might be to devise a macro <<accordian>> that takes the text of the button and the title of a tiddler containing the content. Then one could use the target tiddler title as part of the state tiddler title, making it possible to have multiple accordions within a single tiddler as long as they each target a different tiddler.
I think this is absolute plugin and macro territory.
I think this issue warrants a good solution. I am working on it and think I have found a nice way to implement it. I will share later but here is a hint.
<<reveal-button buttonmame>>
Reusable macro that creates a pair of named toggle buttons. Displaying one according to the state, including a default state. A choice of local or global button. The reveal code is hidden inside the macro and reveals some css in one state and other css in the other state, no one can see this css. The css toggles display: none on the id in question.
In the tiddler body you use html sections or other html tags like a p div or span, with the id=buttonname-show or id=buttonname-hide rather than a reveal widget.
Eg
<section id=buttonname-show>
this wiki text will show if the toggle is in the show state
</section>
Testing shows you can have multiple sections or tags with the same id.
<section id=buttonname-hide>
this wiki text will show if the toggle is in the hide state
</section>
does this sound good?
Tony
does this sound good?
[...] the core, [...] or as you say "Native TW".
2. solving native TW weaknesses with "community plugins" would be okay IF(!!!!) we had a good infrastructure that made all plugins accessible in one place.
I agree with you in principal but I do belive the new mathematics operators are in some ways a minimum requirement. Until now a number of simple things you would expect were not possible without plugins.
Some of Evans formula features should be in the core but a lot of it also makes sense as a plugin.
In the button solution I have developed it is very light weight, and would I believe make a lot of things easier that could justify being in native tiddlywiki but that discussion is for another time.
Regards
Tony
Absolutely right. We should focus our energy, to create a more accessible infrastructure, instead of trying to put everything into the already bloated core. ....
<$list filter="[is[current]button-buttonname-state[true]]" variable=nul>
Show when true
</$list>
<$list filter="[{$:/config/button-buttonname-state}] -[[false]]" variable=nul>
Show when true
</$list>
<$reveal type="match" state="$:/config/button-buttonname-state" text="true">
! This is the revealed content
And this is some text
</$reveal>
<$list filter="[{$:/config/button-buttonname-state}] -[[false]]" variable=nul>
Show when true
</$list>
I currently have a lot of time to tiddle fiddle and hope to pick up on a TWederation project that I had to cut just on the goal line last year. It is based on @Jeds Bob stuff so I just now contacted him to hear if he is available for discussions.
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]
3) For the reveal, are you saying the user should manually type in one (or even several?) of those listwidgets/revealwidgets?
<<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?)
4) Before it is released, may I humbly propose that you make the code more dry, 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>>".
This could really be something useful!
<:-)
Note: Using variable=nul in a list widget
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.
Of course, it expects the user to do some (very basic) html coding in the wikitext - which is fine by me and anyone who masters html, but...
...or, actually, can wikitext elements have css IDs?
One thing to note - at least I think this is how it works - is that if using it for a reveal widget; content isn´t evaluated in revealwidget closed state whereas I believe merely hiding it with display:none does evaluate it. (...right?)
Note: Using variable=nul in a list widgetThat's an interesting use of the variable. Still, I'm not sure why it would be needed in the macro. (Makes me wonder if I also have such "personal touches" that slip along with my public stuff? Hard for one self to tell. )
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.In deed interesting.Some more notes to consider before you publish:
- Inform that buttonname must obey field name rules. (slugify need keeps popping up)
- Must enclose $buttonname$ in triple quotes in some places or <__$$__>
<:-)