In my ongoing journey to build my Gift Ideas notebook, I’m using a template to display on each tiddler tagged as gift, a draggable list of the to-gift field :
That works just fine. What doesn’t work is what I’m typing in the .itemTemplateGiftToGift to include an × that should remove that entry from the to-gift field:
The × doesn’t remove the entries as I thought it would/should. Here’s what looks OK, but doesn’t work OK (I haven’t yet added the × to the list on the right):
That doesn’t seem to work, either from within or from outside the <$button> parameters.
Due to the various references and templating, I’m a little confused on what <<currentTiddler>> means at that point. The chain of itemTemplate ← list-links-draggable macro ← viewTemplate ← actual gift tiddler. I guess it’s the final gift tiddler? If so, why wouldn’t using {!!title} be the same?
Exactly my thought (after having been is similar situations many times). You can add a {{!!title}} just next to the little x for a peek at that value. If that in deed is the problem, you can just $let curr=<<currentTiddler>> somewhere outside the whole construct to use it later inside.
What a brilliant idea, this is what I did and I found out that both {!!title} and <currentTiddler> pointed to the current gift, not the current person.
I first defined a variable as you suggested in the viewTemplate, than I adjusted the .itemTemplate as follows (adding the extra debugging and most importantly adding a $tiddler parameter pointing to the <<curr>> variable):
yeah thats what my tiddlers look all the time when I code in TW. I can barely take cred for that idea though, I’m pretty sure that’s just “how people do it” when bug hunting.
BTW, one should also know of the tiddlerwidget in these situations, allowing for e.g <$tiddler tiddler=<<curr>> > (…which, come to think of it, probably would be exactly the same as doing $let currentTiddler=<<curr>>). I’m not saying this is necessary for your case, it is just a general technique.