1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-06-13 17:16:48 +00:00
TiddlyWiki5/editions/tw5.com/tiddlers/widgets/examples/ActionListopsWidget (Examples).tid
yaisog 1946f173a9
Update ActionListopsWidget documentation including notes on de-duplication (#7301)
* Changed headings under Content

Made them H2 and changed the wording a bit.

* Move the list of filters to another tiddler

There is a tiddler for Extended Listops Filters, and the list should go there, so that the Widget tiddler does not get too overcrowded.

* Rework comparison to ActionSetFieldWidget

* Add notes on de-duplication

* Update link to Extended Listops Filters

* Updated link to Extended Listops Filters

* Update link to Extended Listops Filters

Duh. This was the most important one.

* Remove repeated links to widgets within one section

* Re-create original tiddler with a redirect notice

* Excised the examples into a separate tiddler

Also created an "examples" subdirectory under tw5.com/tiddlers/widgets.
2023-03-04 11:48:14 +00:00

82 lines
2.1 KiB
Plaintext

created: 20230301174431218
list: efg hlm pqr
modified: 20230301174431218
myfield:
revision: 0
title: ActionListopsWidget (Examples)
type: text/vnd.tiddlywiki
In this example we shall populate and then clear a list in an ordinary field (myfield) of this tiddler (the default).
<$macrocall $name='wikitext-example-without-html'
src="""<$button>
<$action-listops $field="myfield" $filter="efg hlm pqr"/>
Populate 'myfield'
</$button>
<$button>
<$action-listops $field="myfield" $subfilter="abc xyz"/>
Append More Items
</$button>
<$button>
<$action-listops $field="myfield" $subfilter="-abc -hlm"/>
Remove Items
</$button>
<$button>
<$action-listops $field="myfield" $filter="[[]]"/>
Clear 'myfield'
</$button>
<$list filter="[list[!!myfield]]">
</$list>"""/>
---
In this example we shall append and remove items from a list in an ordinary field (myfield) of this tiddler (the default) and sort the resultant list. We shall then remove some of the appended items and sort the resulting list in reverse order.
<$macrocall $name='wikitext-example-without-html'
src="""<$button>
<$action-listops $field="myfield" $subfilter="-efg ijk xyz [[this is a title]] +[sort[]]"/>
Mangle List
</$button>
<$button>
<$action-listops $field="myfield" $subfilter="-xyz -[[this is a title]] +[!sort[]]"/>
Unmangle List
</$button>
<$list filter="[list[!!myfield]]">
</$list>"""/>
---
In this example we shall append a few tags to the 'tags' field of this tiddler (the default). We shall then remove some of the appended tags.
<$macrocall $name='wikitext-example-without-html'
src="""<$button>
<$action-listops $tags="+[append{Days of the Week!!short}] $:/tag1 $:/tag2 $:/tag3"/>
Populate 'tags'
</$button>
<$button>
<$action-listops $tags="+[!remove:2{!!tags}]"/>
Remove Last Two Tags
</$button>
<$button>
<$action-listops $tags="+[!prefix[$:/]]"/>
Remove System Tags
</$button>
<$button>
<$action-listops $tags="-Mon -Tue"/>
Remove Mon and Tue
</$button>
<$button>
<$action-listops $tags="+[prefix[$:/]] ActionWidgets Widgets"/>
Remove User Tags
</$button>
<$button>
<$action-listops $tags="+[[]] ActionWidgets Widgets"/>
Clear Tags
</$button>
<$list filter="[list[!!tags]]">
</$list>"""/>