Great,

Using buttons as a trigger around otherwise complex lists containing action 
widgets is a powerful code pattern to learn.

Its a good way to make buttons to do batch changes on tiddlers, this allows 
one to redesign your wiki. Like using tags to set a field then delete the 
tag as one example.

Regards
Tony

On Friday, May 29, 2020 at 7:31:23 AM UTC+10, Lisa Wasserman wrote:
>
> Thank you!  That solved it nicely.  I already had a button that allowed me 
> to switch between editing and viewing the tiddler.  I moved the list inside 
> of the macro, then put the macro call inside of the button that put the 
> tiddler into edit mode.  Here's what I ended up with:
>
> \define journalTiddlerName( ) $(when)$ $(project)$
> \define state() $:/state/$(currentTiddler)$
> \define createTodaysEntry()
> <$list filter="[title[$(journalTiddlerName)$]] +[is[missing]] +[limit[1]]">
> <$action-createtiddler $basetitle="$(journalTiddlerName)$" tags="journal 
> $(project)$" project=$(project)$ description="$(description)$" />
> </$list>
> \end
>
> <$vars project={{!!project}} description={{!!description}} when=<<now 
> DD-MMM-YYYY>> filterwhen=<<now YYYY0MM0DD0hh0mm>>>
> <$reveal type="nomatch" state=<<state>> text="show">
> <p><h1>Today <$button set=<<state>> setTo="show" class="tc-btn-invisible" 
> style="fill:#00aaaa;">{{$:/core/images/edit-button}}<<createTodaysEntry>></$button></h1></p>
> <p><$transclude tiddler=<<journalTiddlerName>> mode="block" /></p>
> </$reveal>
> <$reveal type="match" state=<<state>> text="show">
> <p><h1>Today <$button set=<<state>> setTo="hide" class="tc-btn-invisible" 
> style="fill:#00aaaa;">{{$:/core/images/done-button}}</$button></h1></p>
> <p><$tiddler 
> tiddler=<<journalTiddlerName>>>{{||$:/core/ui/EditTemplate/body/editor}}</$tiddler></p>
> </$reveal>
> </$vars>
>
>
>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/ab680072-21f7-4e27-b55e-67b6aec03872%40googlegroups.com.

Reply via email to