Mark, thanks. That works.

<$wikify> was an answer to a question I had a few months ago, too -- Thomas 
I think used it in one of his macros. I still don't quite get what it does, 
but it seems to do the trick sometimes.


//steve.




On Tuesday, July 25, 2017 at 1:56:48 PM UTC-4, Mark S. wrote:
>
> Try this
>
> \define show-field(this-field)
> this-field=$this-field$<br><hr>
> <$vars this-field=$this-field$ >
> <$list filter="[tag[schedule-elements]each<this-field>sort<this-field>]">
> 0 currentTiddler: <$link><<currentTiddler>></$link><br>
> <$set name=this-value value=<<getFieldValue>>>
> <$wikify name=newtid text="<<makeTiddlerName>>">
> 1 this-field: <<this-field>><br>
> 2 this-value: <<this-value>><br>
> 3 makeTiddlerName: <<newtid>><br>
> 4 <$button>
> <<newtid>>
> <$action-setfield $tiddler=<<newtid>> field-name=<<this-field>> field-
> value=<<this-value>> role="field-value" orig-tag="schedule-elements"/>
> <$action-navigate $to=<<newtid>>/>
> </$button></$wikify></$set><hr>
> \end
>
>
> Used wikify widget to force the macro to be interpreted before use. Also 
> added in missing end tag </$set>
>
> Good luck,
> Mark
>
> On Monday, July 24, 2017 at 5:53:03 PM UTC-7, Steven Schneider wrote:
>>
>> Hi,
>>
>> Can't quite get this right....
>>
>> In http://sunypoly-schedule-explorer.tiddlyspot.com/ the current default 
>> tiddler is a macro that generates a link to tiddlers based on values of a 
>> field in a set of tiddlers. So, in this case, a schedule, <$macrocall 
>> $name="show-field" this-field="room"/> --  all possible values for room 
>> are collected and put in a button; clicking on the button creates a tiddler 
>> that is supposed to be room-{{!!room}}.  It's close -- I'm getting exactly 
>> that: *room-{{!!room}}*. I'd like to transclude the value of room into 
>> the tiddler title, of course. 
>>
>> Any help, much appreciated. Thanks!
>>
>> (I find transcluding field values rather difficult, and I seem to do a 
>> lot of it these days...)
>>
>> //steve.
>>
>>
>>
>> \define getFieldValue() {{!!$(this-field)$}}
>>
>>
>> \define makeTiddlerName() $(this-field)$-$(this-value)$
>>
>>
>> \define show-field($this-field$)
>>
>>
>> <$list 
>> filter="[tag[schedule-elements]each[$this-field$]sort[$this-field$]]">
>> currentTiddler: <$link><<currentTiddler>></$link><br>
>> <$vars this-field=$this-field$ >
>> <$set name=this-value value=<<getFieldValue>>>
>> 1 this-field: <<this-field>><br>
>> 2 this-value: <<this-value>><br>
>> 3 makeTiddlerName: <<makeTiddlerName>><br>
>> <$button>
>> <<makeTiddlerName>>
>> <$action-setfield $tiddler=<<makeTiddlerName>> field-name=<<this-field>> 
>> field-value=<<getFieldValue>> role="field-value" 
>> orig-tag="schedule-elements"/>
>> <$action-navigate $to=<<makeTiddlerName>>/>
>> </$button><br>
>> \end
>>
>> <$macrocall $name="show-field" this-field="room"/>
>>
>>
>>

-- 
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/5f5d2432-959d-47d8-8fab-ff72f23767c9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to