I am trying to implement a simple function in my TW.
<code>
<$button>
<$list filter="[tag[Mark]]">
<!--append exhibition_id to exhibition_id of each marked artwork
tiddler-->
<$action-setfield
$field="exhibition_id"
$value={{{ [{!!exhibition_id}addsuffix[
]addsuffix{$:/TLS/exhibition_id}] }}}
/>
<!--append each artwork_id to artwork_id of the exhibition tiddler-->
<$action-setfield
$tiddler= {{{ [{$:/TLS/exhibition_id}] }}}
$field="artwork_id"
$value={{{ [{$:/TLS/exhibition_id!!artwork_id}addsuffix[
]addsuffix{$:/TLS/artwork_id}] }}}
/>
</$list>
Link Artworks to Exhibition
</$button>
</code>
The first action-setfield works. The second one doesn't but I can not
determine why. It differs from the first in that the first is editing a
field of the <currentTiddler> from a $list widget whilst the second is
editing a field of a tiddler whose title is stored in the tiddler
$:/TLS/exhibition_id.
Is it possible to edit a tiddler not part of the $list widget set?
To my understanding, there are essentially two transclusions involved,
first to get to the tiddler whose title is in $:/TLS/exhibition_id and the
second to the field artwork_id stored in this tiddler.
>From Tones' excellent cheat sheet, I thought I has it right but obviously
not.
There is obviously an error in my wikitext. But what??
Secondly, an earlier query regarding conditional operators with some advice
from Saq Imtiaz.
I want to only perform the action-setfield if the value to be inserted is
not already in the field.
I thought this would work (replacement for the first action-setfield
statement from above).
<code>
<$list [{!!exhibition_id}!contains{$:/TLS/exhibition_id}]
variable="_null" >
<$action-setfield
$field="exhibition_id"
$value={{{ [{!!exhibition_id}addsuffix[
]addsuffix{$:/TLS/exhibition_id}] }}}
/>
</$list>
</code>
but it doesn't.
What an I doing wrong here?
bobj
--
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/1bf189b2-fc92-4303-b121-89921aa4d86cn%40googlegroups.com.