[tw5] Re: How can you display a list at the click of a button?

2021-07-06 Thread Mat
miket... - Somewhat like what Soren says, but not quite:

It doesn't look like you actually want to perform an "action" as it is 
meant in TW but rather just show and hide(?) a regular listing. For this, 
refer to the revealwidget , the 
"accordion" example, like so:

<$reveal type="nomatch" state="$:/state/SampleReveal2" text="show">
<$button set="$:/state/SampleReveal2" setTo="show">Show me

<$reveal type="match" state="$:/state/SampleReveal2" text="show">
<$button set="$:/state/SampleReveal2" setTo="hide">Hide me
* <$list filter="[tag[About]]">*


*<$link/>{{||$:/core/templates/static-tiddler}} *


BTW, this construct is IMO unnecessarily complex and I've called attention 
to this here  with 
a proposal for a simpler "accordionwidget". Do comment there if you agree 
or disagree.

<:-)

On Sunday, July 4, 2021 at 2:47:10 PM UTC+2 miket...@gmail.com wrote:

> For the button I want to make an Action. I took the example from the help 
> as a basis, but of course it does not work :)
>
>
>
>
>
>
>
>
>
>
> *\define my-actions()<$list filter="[tag[About]]"><$link/>   
>  {{||$:/core/templates/static-tiddler}}\end<$button 
> actions=<>>Click me!*

-- 
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/a4412215-46b2-4424-a8dc-5c2148cccd27n%40googlegroups.com.


[tw5] Re: How can you display a list at the click of a button?

2021-07-04 Thread Charlie Veniot
Oops, in the "Modal Viewer" tiddler, I forgot to add a closing bracket to 
one of the HTML elements.  The tiddler should look like this:

!!! Tagged with __''<$text text=<>/>''__

<$list filter="[tag]">
<$link/>
{{||$:/core/templates/static-tiddler}}
*


On Sunday, July 4, 2021 at 1:00:35 PM UTC-3 Charlie Veniot wrote:

> G'day Mike,
>
> I kind of like what you're trying to do.  Because I'm a big fan of modals 
> and I was in a coding mood ...
>
> If you are into the just-for-the-giggles fun of it, give the attached a 
> spin by dragging it into tiddlywiki.com
>
> Instead of a modal, all of this could make for a neat sidebar tiddler 
> (with a search field), for searching and previewing tiddlers.
>
> That was fun.  Haven't even had my first coffee of the day yet ...
>
> On Sunday, July 4, 2021 at 9:47:10 AM UTC-3 miket...@gmail.com wrote:
>
>> For the button I want to make an Action. I took the example from the help 
>> as a basis, but of course it does not work :)
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> *\define my-actions()<$list filter="[tag[About]]"><$link/>   
>>  {{||$:/core/templates/static-tiddler}}\end<$button 
>> actions=<>>Click me!*
>
>

-- 
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/3e66ed8a-8641-4539-ad8d-1be1bdd81fe6n%40googlegroups.com.


[tw5] Re: How can you display a list at the click of a button?

2021-07-04 Thread Charlie Veniot
G'day Mike,

I kind of like what you're trying to do.  Because I'm a big fan of modals 
and I was in a coding mood ...

If you are into the just-for-the-giggles fun of it, give the attached a 
spin by dragging it into tiddlywiki.com

Instead of a modal, all of this could make for a neat sidebar tiddler (with 
a search field), for searching and previewing tiddlers.

That was fun.  Haven't even had my first coffee of the day yet ...

On Sunday, July 4, 2021 at 9:47:10 AM UTC-3 miket...@gmail.com wrote:

> For the button I want to make an Action. I took the example from the help 
> as a basis, but of course it does not work :)
>
>
>
>
>
>
>
>
>
>
> *\define my-actions()<$list filter="[tag[About]]"><$link/>   
>  {{||$:/core/templates/static-tiddler}}\end<$button 
> actions=<>>Click me!*

-- 
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/e4700063-c464-474b-b570-a1cd64fe4272n%40googlegroups.com.


AlternativeIdeaForMike.json
Description: application/json


[tw5] Re: How can you display a list at the click of a button?

2021-07-04 Thread Soren Bjornstad
Mike,

An action cannot directly contain wikitext that should appear -- it can 
generally only contain action widgets (there are a few exceptions, like you 
can use a list widget to create a bunch of actions matching some pattern). 
The general pattern for creating a button that hides/shows content is to 
create a field that contains information about whether or not to show the 
content, then use a $reveal or $list widget to control whether it appears. 
For instance, to use a field called "show-content" on the current tiddler 
to control the display:

\define show-actions() <$action-setfield show-content="yes"/>
\define hide-actions() <$action-setfield show-content="no"/>

<$reveal state="show-content" type="match" text="yes">
  <$list filter="[tag[About]]">
<$link/>
{{||$:/core/templates/static-tiddler}}
  
  <$button actions=<>>Hide me again

<$reveal state="!!show-content" type="nomatch" text="yes">
  <$button actions=<>>
Click me!
  


(Note that unlike in your example, I've included an action and button to 
hide the content again. You can of course take that out if you don't want 
it...but the only way to get the content to go away again will be to go in 
and manually change the field on the current tiddler.)

You might also like to use a temporary tiddler, rather than a field on the 
current tiddler, to store whether the content should be open. If so, you 
would do something like:

\define show-actions() <$action-setfield $tiddler=<> show-content="yes"/>

<$reveal state=<> type="match" 
text="yes">

<> may not be necessary depending on your use case -- it prevents 
name collisions if you use this as a template on multiple tiddlers 
(otherwise, clicking the "show" button on one tiddler that uses the 
template will result in the content showing on all of them).

More information: Hiding and Showing Things 
 (Grok 
TiddlyWiki), action widgets  (TW 
docs), $reveal widget  (TW docs), qualify 
macro  (Grok TiddlyWiki).
On Sunday, July 4, 2021 at 7:47:10 AM UTC-5 miket...@gmail.com wrote:

> For the button I want to make an Action. I took the example from the help 
> as a basis, but of course it does not work :)
>
>
>
>
>
>
>
>
>
>
> *\define my-actions()<$list filter="[tag[About]]"><$link/>   
>  {{||$:/core/templates/static-tiddler}}\end<$button 
> actions=<>>Click me!*

-- 
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/5f8b9f90-8c60-4225-9873-a59dcfdd2ce5n%40googlegroups.com.