[HelpRequest] tag pill dropdown twak

110 views
Skip to first unread message

David Gifford

unread,
Dec 15, 2020, 6:17:56 PM12/15/20
to TiddlyWiki

Ugh. Why does the tagging mechanism have to be so complicated?

I created a list-search for all the tags in a file, where the tags show as tag pills. But I would like the dropdown list of tiddlers (when pressing the tag pill) to show the equivalent of

<$transclude field="extlink"/>

instead of the equivalent of

<$link><$view field="title"/></$link>

The extlink field has [[name of tiddler|external link]] so when clicking, the link will take you to the external website.

Use case: an index of links to all my Spanish resources on different parts of the Internet.

Thanks in advance for any love.

David Gifford

unread,
Dec 15, 2020, 6:18:19 PM12/15/20
to TiddlyWiki
tweak, not twak.

TW Tones

unread,
Dec 15, 2020, 6:49:40 PM12/15/20
to TiddlyWiki
David,

This is too easy to solve.

Install my macros attached and click on any tag pill, see how it extends the tag pill

Then Clone $:/PSaT/copy-tag and make your own tiddler tagged $:/tags/TagDropdown
with your desired content.

Regards
Tones

reimagin-tags.json

David Gifford

unread,
Dec 15, 2020, 7:25:48 PM12/15/20
to tiddl...@googlegroups.com
Thanks Tones! I will try it out!

David Gifford
Mexico team leader, Mexico City

Resonate Global Mission
Engaging People. Embracing Christ.
A Ministry of the Christian Reformed Church
resonateglobalmission.org



--
You received this message because you are subscribed to a topic in the Google Groups "TiddlyWiki" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tiddlywiki/KD1b-c_OE4A/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tiddlywiki+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/0568a19f-98e9-4ec5-afce-b01ea86f7132n%40googlegroups.com.

David Gifford

unread,
Dec 16, 2020, 10:02:19 AM12/16/20
to TiddlyWiki
Hi Tones,

Alas, what is "too easy" for you is beyond the grasp of mere mortals such as I.

I was not looking for a way to add a button to the tag pill dropdown, as cool as that is. I was looking for a way to alter the functionality of the list of tiddlers at the bottom of the dropdown. I would like each of them to display as the extlink field with no link to the tiddler.

I tried adapting these tiddlers, which looked promising, but that did nothing.

$:/PSaT/tagging-here/ListItemTemplate
$:/PSaT/tagging-here/ListItemTemplate 1

Any ideas?

Jed Carty

unread,
Dec 16, 2020, 11:36:31 AM12/16/20
to TiddlyWiki
David,

While it is certainly not, as has been said, 'too easy' it is doable.

The tags macros are complex because of how flexible they need to be and how many different situations they are used in. It makes it rather difficult to figure out what you change to get your desired alternate behaviour.

The tiddler to copy (or edit) is $:/core/ui/TagTemplate

If you edit it you will change how every tag in the wiki behaves. It sounds like that is what you want, if not you would need a to use it as a template like {{tiddlerToMakeTagOf||ModifiedTagTiddler}}

anyway, put this inside the tiddler $:/core/ui/TagTemplate

The line 

<a href=<<currentTiddler>> target="_blank"><$text text=<<currentTiddler>>/></a>

is what sets what is on the list, here it is just a simple link to the title of the current tiddler that gets opened in a new browser tab. If that isn't what you want either let me know or change the line to be what you want.


\whitespace trim
<span class="tc-tag-list-item">
<$set name="transclusion" value=<<currentTiddler>>>
<$macrocall $name="tag-pill-body" tag=<<currentTiddler>> icon={{!!icon}} colour={{!!color}} palette={{$:/palette}} element-tag="""$button""" element-attributes="""popup=<<qualify "$:/state/popup/tag">> dragFilter='[all[current]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">
<$transclude tiddler="$:/core/ui/ListItemTemplate"/>
</$set>
<$list filter="[all[shadows+tiddlers]tag[$:/tags/TagDropdown]!has[draft.of]]" variable="listItem"> 
<$transclude tiddler=<<listItem>>/>
</$list>
<hr>
<$list filter='[tag<currentTiddler>]'>
<a href=<<currentTiddler>> target="_blank"><$text text=<<currentTiddler>>/></a>
</$list>
</$reveal>
</$set>
</span>


To use this in a list put it in some other tiddler, I am assuming you call it ModifiedTagTiddler, then make your list of tags like this:

<$list filter=<<whatever filter you are using>>>
{{||ModifiedTagTiddler}}
</$list>

hopefully that helps.

Jed Carty

unread,
Dec 16, 2020, 11:58:28 AM12/16/20
to TiddlyWiki
Reading over that it isn't organised very well, and I forgot to put in what you actually wanted for each item in the list, so this is the content of the tiddler with what you said you wanted in it:

\whitespace trim
<span class="tc-tag-list-item">
<$set name="transclusion" value=<<currentTiddler>>>
<$macrocall $name="tag-pill-body" tag=<<currentTiddler>> icon={{!!icon}} colour={{!!color}} palette={{$:/palette}} element-tag="""$button""" element-attributes="""popup=<<qualify "$:/state/popup/tag">> dragFilter='[all[current]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">
<$transclude tiddler="$:/core/ui/ListItemTemplate"/>
</$set>
<$list filter="[all[shadows+tiddlers]tag[$:/tags/TagDropdown]!has[draft.of]]" variable="listItem"> 
<$transclude tiddler=<<listItem>>/>
</$list>
<hr>
<$list filter='[tag<currentTiddler>]'>
<$transclude field="extlink"/>
</$list>
</$reveal>
</$set>
</span>

David Gifford

unread,
Dec 16, 2020, 1:30:51 PM12/16/20
to TiddlyWiki
Thanks inmy! (Google only lets me see the first few letters of the email...)

I got it to work:

1. I cloned $:/core/ui/TagTemplate and pasted your code. I named the new tiddler $:/.giffmex/ui/TagTemplate
2. Paste this in a tiddler: <$list filter="[!is[system]is[tag]field:extlink[]]"> <$transclude tiddler="$:/.giffmex/ui/TagTemplate"/> </$list>
3. Links in tag dropdowns that are accessed from anywhere but that listwidget open the tiddler. Links from the above listwidget open the external websites.


Case closed, and I will add this to the documenting.tw site later today (https://giffmex.org/gifts/documenting.tw.html)!

TW Tones

unread,
Dec 16, 2020, 9:04:16 PM12/16/20
to TiddlyWiki
David,

This is an interesting solution, I was suggesting adding this functionality in a tiddler tagged $:/tags/TagDropdown
  • That is it adds another list to the drop down with links if present in tiddlers. This would allow you to still open the tiddlers so tagged.
On further reflection I can see having the Tag dropdown that lists tiddlers as usual then; if we modify 
  • For those with an  extlink field present a 🌏icon that will open in a new tab the link
  • For those with a link field present a 🔗 that will open a tiddler in the current wiki
Of course the same can be displayed for the tagname of the current tag as well if it has link field(s)

Tones

David Gifford

unread,
Dec 16, 2020, 9:35:12 PM12/16/20
to tiddl...@googlegroups.com
Hi Tones

Yes, I like your idea, best of both worlds. I may modify my site based on that. But I am going to give it a break for a day or two. Getting OD'd on TiddlyWiki tweaks




--
You received this message because you are subscribed to a topic in the Google Groups "TiddlyWiki" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tiddlywiki/KD1b-c_OE4A/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tiddlywiki+...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages