Creating a New Tiddler Working ... but how to insert variable as value?

64 views
Skip to first unread message

David

unread,
Apr 3, 2020, 1:42:28 PM4/3/20
to TiddlyWiki
This code shows my shopping items and whether I've gotten them yet or not.  It lists everything grouped in sections.

At the bottom of each section, I want a "New" button that opens a  new tiddler.  This is working.

But I'd love to pre-fill that "sams_club_section" field with the current section, which is stored in the "thisSection" variable.

The dollar before and after syntax, as shown below, in the $button code, is not right.  I've tried a few others.  I'm sure you guys know how to do it.

<$list filter="[list[$:/.my/data/Shopping/SamsClubSections]]" variable="thisSection">

!! <
<thisSection>>

<$list filter="[
<thisSection>listed[sams_club_section]tag[ShoppingItem]tag[ToGet]]" variable="item">
&nbsp; &nbsp; <$checkbox tiddler=<
<item>> tag="Selected"/> <<item>><br/>
</$list>

<$button>
<$action-sendmessage $message="tm-new-tiddler"
 title=""
 tags="ShoppingItem SamsClub"
 sams_club_section="
$thisSection$"
/>
New
</$button>

</$list>


Saq Imtiaz

unread,
Apr 3, 2020, 4:19:14 PM4/3/20
to TiddlyWiki
Try:

sams_club_section=<<thisSection>>

This is the synax for referring to variables and macros, the $name$ syntax only works inside of macros for text subsitution.

David

unread,
Apr 6, 2020, 7:39:28 AM4/6/20
to TiddlyWiki
That worked!  Excellent!
Reply all
Reply to author
Forward
0 new messages