On Sunday, February 9, 2020 at 9:42:42 AM UTC-8, myfta wrote:
>
> OK, I'm new here.
>

Welcome!
 

> I have a group of tiddlers with the same tag.
> I want to be able to list these in a "dashboard" tiddler so that I can 
> edit some of the fields within the individual tiddlers.
> The $edit-text widget <https://tiddlywiki.com/#EditTextWidget>and the $list 
> widget <https://tiddlywiki.com/#ListWidget> seem to have the right 
> options, but no examples of how to use them (for a newbie). Ideally, I want 
> to nest $edit-text inside $list so give me a table of fields from a set of 
> tiddlers that can be edited. Or is there a better way?
>

The $list widget uses the "filter" syntax to specify a set of tiddlers to 
operate on.  You can think of the list widget as a "loop" control.  For 
each tiddler that matches the filter, the <<currentTiddler>> variable is 
set for use inside the <$list>...</$list>.  For your purposes, let's assume 
you are working with tiddlers tagged with "sometag".  Thus, you would write:
<$list filter="[tag[sometag]]">
  <<currentTiddler>><br>
   ... more stuff goes here ...
</$list>

In the above example, the $list widget loops through all tiddlers that 
match the specified tag, and displays the title of each matching tiddler, 
one per line.

The $edit-text widget creates a text input control that allows you to 
display and modify the value in a specified field.  Entering/changing the 
text in an input control immediately changes the text value stored in the 
corresponding field, without needing any "ok/cancel" button.  For your 
purposes, let's assume you want to change three fields named "foo", "bar", 
and "baz".  To do this, you would write:
enter foo: <$edit-text field="foo" /><br>
enter bar: <$edit-text field="bar" /><br>
enter baz: <$edit-text field="baz" /><br>

Notes:
* By default, if no "tiddler" parameter is specified, the 
<<currentTiddler>> is implied.
* Each widget ends with "/>" rather than the usual ">".  This is an 
abbreviated form of <$edit-text ...>...</$edit-text>.  We can use this 
syntax because the $edit-text widget does not need any content *within* the 
widget.
* The "enter xxx:" text that appears before the $edit-text widget is just 
normal content that will be displayed as a "prompt" in front of each input 
field
* The <br> following each $edit-text widget ensures that each input control 
appears on a line by itself.
* There are other $edit-text parameters that can be helpful here, such as 
"size" and "default".  I leave this to you to experiment and discover.

Combining the $list and $edit-text from above, and adding a little bit of 
extra "formatting", we can get something like this:
<$list filter="[tag[sometag]]">
   <<currentTiddler>>:<br>
   <blockquote>
      enter foo: <$edit-text field="foo" /><br>
      enter bar: <$edit-text field="bar" /><br>
      enter baz: <$edit-text field="baz" /><br>
   </blockquote>
</$list>

Note that <blockquote>...</blockquote> is a normal HTML syntax rather than 
a TiddlyWiki widget (there's no leading $).  This shows that you can freely 
mix HTML and TiddlyWiki syntax together to achieve the desired display of 
output.  Of course, you might want a different appearance of the output, 
but again, I leave that to you to experiment and discover.

Hopefully, this is enough to get you started in the right direction.  If 
you have more questions, don't hesitate to ask.

enjoy,
-e
Eric Shulman
TiddlyTools.com: "Small Tools for Big Ideas!" (tm)
InsideTiddlyWiki - http://www.TiddlyTools.com/InsideTW







-- 
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/cf34a738-eef0-4718-84a2-8550982bdaea%40googlegroups.com.

Reply via email to