\define buttonActions()
<$list filter="[tag[Mark]]">
     <!--add global exhibition_id to the exhibition_id list-field of each 
marked artwork tiddler-->
     <!--$listops $subfilter will append any new filter run to the existing 
list-field-->
           <$action-listops
               $field="exhibition_id" 
               $subfilter="[{$:/TLS/exhibition_id}]"
          />


<$action-log message="artwork_id" value={{!!artwork_id}} />
   
     <!--append each artwork_id to artwork_id list-field of the exhibition 
tiddler-->
          <$action-listops
               $tiddler= {{$:/TLS/exhibition_id}}
               $field="artwork_id" 
               $subfilter={{!!artwork_id}}
          />


<$action-log message="exhibition_id" value={{$:/TLS/artwork_id}} />


    
</$list>
\end


This action will link the marked artworks with the selected exhibition.


The list of marked artworks


<$list 
     filter="[tag[Artworks]tag[Mark]!<currentTiddler>sort[title]]">
     &bull; 
     <$link/>
     <$view  field="artwork_title" /> 
     <$view field="artwork_type"/>
     <br/>
</$list>


<!-- the selected exhibition id will be stored in the exhibiton_id field on 
this tiddler-->
Choose the exhibition from this list:


<$macrocall 
     $name="edit-list" 
     tiddler="$:/TLS/exhibition_id"
     listview="{{{ [<value>get[exhibition_name]] }}}" 
     filter="[tag[Exhibitions]!tag[Index]]" 
/>


<$log message="macrocall exhibition_id" value={{$:/TLS/artwork_id}} />


<$button actions=<<buttonActions>> >
Link Artworks to Exhibition
</$button>


In a rush but hope this helps. You were assigning the same value for 
artwork id over and over from a tiddler, instead of getting it from the 
field of the current tiddler in the list loop.

-- 
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/ad9c3622-665b-4389-8ef8-5fcebe7a5599o%40googlegroups.com.

Reply via email to