Help with External Links and Shiraz Buttons

82 views
Skip to first unread message

Dan Hoffman

unread,
Apr 25, 2021, 5:40:54 AM4/25/21
to TiddlyWiki
Hello All,

I am new to TW and very much a beginner. I'm using TiddlyWiki on Node.js

I've learned to use External Links and find myself frequently using them to link to various  files, something like this:
  • [ext[Link to PDF|file:///myfile.pdf]]
I've also had luck applying External Links to links generated by Hook (the macOS productivity app). These links look something like this:
  • [ext[Link to Email|hook://email/ABC123.gmail.com]]
  • [ext[Link to Folder|hook://file/ABC123]]
All of this works very well. My question is how I can combine External Links with buttons made using the Shiraz plugin. In Shiraz, a button looks something like this:
  • <$link overrideClass="btn btn-primary" to="target">My Link</$link>
However, when I replace "target" with an External Link (one that works without a Shiraz button), it no longer works. Instead, the button treats the link as a tiddler title instead of opening the file in the correct app (e.g., Mail, Preview, Finder). This is what I expected to work:
  • <$link overrideClass="btn btn-primary" to="hook://email/ABC123.gmail.com">My Link</$link>
I have also tried this:
  • <$link overrideClass="btn btn-primary" to="[ext[hook://email/ABC123.gmail.com]]">My Link</$link>
I feel like I'm missing something very basic, but I just can't seem to figure it out. Can anyone point me in the right direction?

To summarize, I'd like to combine an External Link with a Shiraz button so that that button opens the local file.

Thank you kindly for any help you might be able to offer.



Javier Eduardo Rojas Romero

unread,
Apr 25, 2021, 12:24:00 PM4/25/21
to tiddl...@googlegroups.com
Hello; I think the issue is: <$link> only works for internal links; for
external links, use good ol' HTML, for example:

<a href="https://google.com" target="_blank" class="btn btn-primary">open google in a new tab</a>

On Sun, Apr 25, 2021 at 02:40:53AM -0700, Dan Hoffman wrote:
> Hello All,
>
> I am new to TW and very much a beginner. I'm using TiddlyWiki on Node.js
>
> I've learned to use External Links
> <https://tiddlywiki.com/#Linking%20in%20WikiText> and find myself
> frequently using them to link to various files, something like this:
>
> - [ext[Link to PDF|file:///myfile.pdf]]
>
> I've also had luck applying External Links to links generated by Hook
> <https://hookproductivity.com/> (the macOS productivity app). These links
> look something like this:
>
> - [ext[Link to Email|hook://email/ABC123.gmail.com]]
> - [ext[Link to Folder|hook://file/ABC123]]
>
> All of this works very well. My question is how I can combine External
> Links with buttons made using the Shiraz plugin
> <https://kookma.github.io/TW-Shiraz/#>. In Shiraz, a button looks something
> like this:
>
> - <$link overrideClass="btn btn-primary" to="target">My Link</$link>
>
> However, when I replace "target" with an External Link (one that works
> without a Shiraz button), it no longer works. Instead, the button treats
> the link as a tiddler title instead of opening the file in the correct app
> (e.g., Mail, Preview, Finder). This is what I expected to work:
>
> - <$link overrideClass="btn btn-primary" to="
> hook://email/ABC123.gmail.com">My Link</$link>
>
> I have also tried this:
>
> - <$link overrideClass="btn btn-primary" to="
> [ext[hook://email/ABC123.gmail.com]]">My Link</$link>
>
> I feel like I'm missing something very basic, but I just can't seem to
> figure it out. Can anyone point me in the right direction?
>
> To summarize, I'd like to combine an External Link with a Shiraz button so
> that that button opens the local file.
>
> Thank you kindly for any help you might be able to offer.
>
>
>
> --
> 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+...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/2bc559c3-6466-48a7-936b-b5aac2c67a95n%40googlegroups.com.

Dan Hoffman

unread,
Apr 25, 2021, 4:08:06 PM4/25/21
to TiddlyWiki
Thank you! Thank you! That 100% did the trick. I knew it was something simple, I just don't have quite enough background knowledge (yet). But I'm learning ;-)
Reply all
Reply to author
Forward
0 new messages