Thanks Eric, that's great.

So with this approach, we can willy-nilly loop through field values for 
listed tiddlers. Very nice!

On Friday, March 10, 2017 at 4:46:20 PM UTC-5, Eric Shulman wrote:
>
> On Friday, March 10, 2017 at 1:28:04 PM UTC-8, stevesuny wrote:
>>
>> My question: How can I get Method One to place a line break after teach 
>> name/value pair? Seems that would be more efficient and more elegant than 
>> method Two, which works well enough, but requires six lines rather than one 
>> line of code. I've just discovered the $fields command, and am exploring 
>> uses for it. Thanks! //steve.
>>
>> <$list filter="[is[current]tag[wish]]">
>> <h1>One</h1>
>> <$fields template='$name$: $value$'/>
>>
>> <h2>Two</h2>
>> <$wikify name=tid text={{!!title}}>
>> <$list filter="[<tid>fields[]] -[[text]]" variable="fieldname">
>> <$text text=<<fieldname>>/>:
>> <$view tiddler=<<tid>> field=<<fieldname>>/><br>
>> </$list>
>> </$wikify>
>>
>>
>> </$list>
>>
>> The documentation for <$fields> says that it is used *internally* by the 
> TW core (in particular, the FileSavingMechanism).  The 'template' param 
> only accepts plain text and two special variable references ($name$ and 
> $value$).  It has very limited ability control the output format.  Using 
> <$list> allows you to provide whatever output formatting you like.
>
> Also, you don't need to use <$wikify> to get the current tiddler's title, 
> and you don't need to provide the tiddler="..." param to <$text> and 
> <$view> because the <<currentTiddler>> is used by default.  You can reduce 
> the code to just 3 lines:
> <$list filter="[<currentTiddler>fields[]] -[[text]]" variable="fieldname">
>    <$text text=<<fieldname>>/>: <$view field=<<fieldname>>/><br>
> </$list>
>
> enjoy,
> -e
> Eric Shulman
> TiddlyTools: Small Tools for Big Ideas! (tm)
> InsideTiddlyWiki: The Missing Manuals
>

-- 
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 post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/eefbbc16-5e49-4cba-8fb8-b224cd4cd1f0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to