Mark, that did it! thanks! will post corrected code with doc later. Eric & Mark, thanks! //steve.
On Friday, July 14, 2017 at 1:09:35 PM UTC-4, Mark S. wrote: > > I don't have time to look at this right now, but the first thing I would > try is going back to Eric's example and changing <$vars> to > > <$wikify name=this-value text=<<getFieldValue>>> ... </$wikify> > > Good luck! > Mark > > On Friday, July 14, 2017 at 8:21:57 AM UTC-7, stevesuny wrote: >> >> Eric, this *almost* works, thanks! So close...I can see it working :) >> >> The challenge remains building a link to a tiddler represented by a >> transcluded value of a filtered tiddler. >> >> >> >> You had >> >> <$list filter="[tag[schedule-elements]each<this-field>sort<this-field>]"> >> <$vars this-value=<<getFieldValue>>> >> <<this-field>>: <$link><<this-value>></$link><br> >> >> which created a link to the filtered tiddler not the value tiddler. >> >> >> I changed it to >> >> <$list filter="[tag[schedule-elements]each<this-field>sort<this-field>]"> >> <$vars this-value=<<getFieldValue>>> >> <<this-field>>: <<this-value>>: Link to <$link >> to=<<this-value>>><<this-value>></$link><br> >> >> which doesn't quite work: if <<this-field>> is "instructor" my link goes >> to {{!!instructor}} >> >> So I must be only one level off on the transclusion...so close! >> >> //steve. >> >> >> >> On Thursday, July 13, 2017 at 5:17:07 PM UTC-4, Eric Shulman wrote: >>> >>> On Thursday, July 13, 2017 at 1:19:14 PM UTC-7, stevesuny wrote: >>>> >>>> I thought that, too. >>>> >>>> The problem: <$set name="this-value" value=<<currentTiddler>>> names >>>> to the current tiddler, not the value of the field that I am interested in. >>>> >>>> How do I set this-value to a field value, whose name is itself a >>>> variable? >>>> >>> >>> This situation is referred to as "double indirection" (i.e. using one >>> variable to hold the name of another variable that contains the desired >>> value) >>> >>> Try using a little "helper" function to construct the desired >>> reference... >>> >>> Something like this: (untested) >>> \define getFieldValue() {{!!$(this-field)$}} >>> >>> <$list filter="[all[current]tag[element-field]]" >>> <$vars this-field=<<currentTiddler>>> >>> <$list filter= >>> "[tag[schedule-elements]each<this-field>sort<this-field>]"> >>> <$vars this-value=<<getFieldValue>>> >>> <<this-field>>: <$link><<this-value>></$link><br> >>> </$vars> >>> </$list> >>> </$vars> >>> </$list> >>> >>> <<getFieldValue>> uses the $(...)$ syntax to substitute the current >>> field name into the transclusion syntax. Thus, if this-field has a value >>> of "foobar", <<getFieldValue>> will return "{{!!foobar}}" which is then >>> parsed by the <$vars> widget to retrieve the field value and assign it to >>> the "this-value" variable >>> >>> Note: instead of using the <$set name="foo" value="bar"> syntax, I >>> prefer to use the <$vars foo="bar"> syntax.... they both will have the same >>> result, but <$vars> seems easier to read. >>> >>> enjoy, >>> -e >>> >> -- 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 tiddlywiki+unsubscr...@googlegroups.com. To post to this group, send email to tiddlywiki@googlegroups.com. 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/2d68afad-e90b-4dca-82ec-e574f42da270%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.