Filks
Here is a fix

Define a tag2 macro
\define tag2(tag)
<$set name=currentTag value="$tag$">
{{||$:/core/ui/TagTemplate2}}
</$set>
\end

Create a new template $:/core/ui/TagTemplate2
\whitespace trim
<span class="tc-tag-list-item">
<$set name="transclusion" value=<<currentTag>>>
<$macrocall $name="tag-pill-body" tag=<<currentTag>> icon={{!!icon}} colour
={{!!color}} palette={{$:/palette}} element-tag="""$button""" 
element-attributes="""popup=<<qualify "$:/state/popup/tag">> 
dragFilter='[<currentTag>]tagging[]]' tag='span'"""/>
<$reveal state=<<qualify "$:/state/popup/tag">> type="popup" position=
"below" animate="yes" class="tc-drop-down">
<$set name="tv-show-missing-links" value="yes">
<$tiddler tiddler=<<currentTag>> >
<$transclude tiddler="$:/core/ui/ListItemTemplate"/>
</$tiddler>
</$set>
<$list filter=
"[all[shadows+tiddlers]tag[$:/tags/TagDropdown]!has[draft.of]]" variable=
"listItem"> 
<$tiddler tiddler=<<currentTag>> >
<$transclude tiddler=<<listItem>>/> 
</$tiddler>
</$list>
<hr>
<$macrocall $name="list-tagged-draggable" tag=<<currentTag>>/>
</$reveal>
</$set>
</span>

Now when you call the tag2 macro it will respond to the current tiddler.
However the following demonstrates how if the currentTiddler changes the 
Qualify will
<$list filter="1 2">
   <$list filter="[all[]tags[]sort[]]" variable=tagname>
      <$macrocall $name=tag2 tag=<<tagname>>/>
   </$list>
</$list>

So if the vertical list of items become the currentTiddler the tag popup 
will be qualified not by the tag but the currentTiddler.

Seems to work!

Tony



On Wednesday, March 18, 2020 at 3:21:53 PM UTC+11, TonyM wrote:
>
> Ahh,
>
> Yes, I see now, the first macro involved is 
> \define tag(tag)
> {{$tag$||$:/core/ui/TagTemplate}}
> \end
>
> So the current Tiddler is set to $tag$ for the tag template, which then 
> calls qualify for each tag.
> Since it is in effect not keeping the currentTiddler, it sets it to 
> currentTag we can't fake it. 
>
> I am sure a simple modification or two to the macros will resolve this, or 
> an improved qualify.
>
> I will give it some thought.
>
> Regards
> Tony
>
>
>
>
> On Wednesday, March 18, 2020 at 12:54:49 PM UTC+11, Soren Bjornstad wrote:
>>
>> On Tuesday, March 17, 2020 at 5:22:08 PM UTC-5, TonyM wrote:
>>>
>>> The number generated by Qualify is related to the tiddlername, 
>>> specifically the current tiddler so if that changes for each tag, as in my 
>>> first post the issue only occurs if the same tag is referenced in the same 
>>> tiddler with the same currentTiddler value. In Soren's original post his 
>>> current Tiddler need only change according to the items in the left hand 
>>> list, and the mentioning of the same tag in the list should not result in 
>>> multiple popups as each is qualified by the tiddler in the left hand list.
>>>
>>
>> I think each is qualified by the tiddler in the *inner* list, the way it 
>> stands, since currentTiddler gets overwritten by the innermost $list widget 
>> -- right? Are you suggesting I could skip overwriting currentTiddler to 
>> solve the problem? I tried setting the innermost list to use a variable 
>> <<innerTiddler>> instead, but this did not help since there is only one 
>> parameter to the <<tag>> macro which is used as the current tiddler to the 
>> tag template. That variable has then to be set to innerTiddler instead of 
>> currentTiddler to render the correct thing, and the problem just starts all 
>> over again.
>>
>>
>> On Tuesday, March 17, 2020 at 7:08:41 AM UTC-5, Saq Imtiaz wrote:
>>>
>>> The quickest solution would be to use your own template, a modified 
>>> version of the $:/core/ui/TagTemplate
>>>
>>> This is untested code and not the most elegant, but something like this 
>>> should work:
>>>
>>
>> This worked, thanks! It seems a lot more complicated of a solution than 
>> this ought to require, but if I don't find something better this will do.
>>
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/d5529673-922f-4184-a906-0d343f5ceffc%40googlegroups.com.

Reply via email to