I've never had any luck passing a <<macro>> with parameters to a widget. 
What I would do is use another <$set> widget before the existing set that 
would provide the increment value. For instance something like "incvalue" 
Then inside of <<increment>> refer to it as $(incvalue)$. It might look 
like ...

<$button>New Hive

<$set name="incvalue" value="3"> 

>     <$set name="counter" value=<<increment>>>
>         <$action-sendmessage $message="tm-new-tiddler" title=Hive 
> #<<counter>> tags="active Hive" />
>
>     <$action-setfield $tiddler="$:/state/beehive" $field="hiveCounter" 
> $value=<<counter>> />
>
>     </$set>
>
</$set> 

> </$button>
>

HTH
Mark 
 

On Tuesday, April 4, 2017 at 3:38:52 AM UTC-7, Tristan Kohl wrote:
>
> Hey guys,
>
> it is me again. Still working on my website and coming up with another 
> problem. I still can not completely wrap my head around how to achieve some 
> simple - at least I think they are - things. I am writing a plugin for my 
> site to track my beekeeping and therefore made a button which "creates" a 
> new hive and increments a global counter.
>
> However since this whole thing should be a plugin I do not want to store a 
> "counter" within the sidebar tiddler containing the button but rather have 
> a "state" tiddler handling this as there are a couple of things I want to 
> increment (queens, hives, checks...). My problem is that I do not know how 
> to "get" the value from the state tiddler in the first place so I can 
> increment it and set the new value (increment macro does work).
>
> As of now I have this (what do I have to insert at the question marks?):
>
> <$button>New Hive
>
>     <$set name="counter" value=<<increment ???>>>
>>         <$action-sendmessage $message="tm-new-tiddler" title=Hive 
>> #<<counter>> tags="active Hive" />
>>
>>     <$action-setfield $tiddler="$:/state/beehive" $field="hiveCounter" 
>> $value=<<counter>> />
>>
>>     </$set>
>> </$button>
>>
>
> Thanks in advance.
> Cheers,
> Tristan
>

-- 
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/ae6a80d8-413d-481b-8e4a-ea0614a229e2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to