Re: [tw5] Re: Return link if exists otherwise external link

2021-04-20 Thread Mohammad Rahmani
Thank you Mat! Nice addition! Best wishes Mohammad On Tue, Apr 20, 2021 at 10:53 PM Mat wrote: > Mohammad wrote: > >> How the URL shall be given as an encoded uri? >> > > See https://link-or-ext.tiddlyhost.com/ > > The macro is called like this > >

Re: [tw5] Re: Return link if exists otherwise external link

2021-04-20 Thread Mat
Mohammad wrote: > How the URL shall be given as an encoded uri? > See https://link-or-ext.tiddlyhost.com/ The macro is called like this > i.e the URL is just copy-pasted from some wiki. By the way, you who also create a lot of community

Re: [tw5] Re: Return link if exists otherwise external link

2021-04-20 Thread Mohammad Rahmani
Mat, How the URL shall be given as an encoded uri? Best wishes Mohammad On Tue, Apr 20, 2021 at 12:54 PM Mat wrote: > Saq Imtiaz wrote: > >> Use a filter run prefix. >> > > Appreciated. That'll be useful in other cases but it turns out it was not > relevant for this issue. > >

[tw5] Re: Return link if exists otherwise external link

2021-04-20 Thread Saq Imtiaz
That makes sense and yes it isn't how emptyMessage works, as the variable is only set by the ListWidget when the filter has a result. I had assumed from your code that you wanted {{!!title}} in the emptyMessage to mean you wanted the title of the currentTiddler as set outside the list widget.

[tw5] Re: Return link if exists otherwise external link

2021-04-20 Thread Mat
>{{!!title}} in emptyMessage will correspond to the title of the the currentTiddler variable outside the ListWidget. >Perhaps explain what it is you expect when using {{!!title}} in emptyMessage. Thanks for following up! Exactly, {{!!title}} would get the title outside the listwidget. What I

[tw5] Re: Return link if exists otherwise external link

2021-04-20 Thread Saq Imtiaz
Hi Mat, are you sure about that? @Saq - thanks, I actually tried that, but the problem is that emptyMessage > doesn't know what {{!!title}} is, so to say. (It would be desirable that it > did!) > > {{!!title}} in emptyMessage will correspond to the title of the the currentTiddler variable

[tw5] Re: Return link if exists otherwise external link

2021-04-20 Thread Mat
@Saq - thanks, I actually tried that, but the problem is that emptyMessage doesn't know what {{!!title}} is, so to say. (It would be desirable that it did!) <:-) On Tuesday, April 20, 2021 at 10:26:55 AM UTC+2 Saq Imtiaz wrote: > You could also try something like this (untested): > >

[tw5] Re: Return link if exists otherwise external link

2021-04-20 Thread Saq Imtiaz
You could also try something like this (untested): \define linkOrExt(url) <$list filter="""$url$ +[split[#]rest[]decodeuri[]join[ ]!is[missing]]""" emptyMessage="""> rel="noopener noreferrer" target="_blank">{{!!title}}"""> {{{ [<__url__>split[#]rest[]decodeuri[]join[ ]] }}} \end On Tuesday,

[tw5] Re: Return link if exists otherwise external link

2021-04-20 Thread Mat
Saq Imtiaz wrote: > Use a filter run prefix. > Appreciated. That'll be useful in other cases but it turns out it was not relevant for this issue. But formulating the problem that emptyMessage was not linkified did spark some thoughts so the current status is decent enough:

[tw5] Re: Return link if exists otherwise external link

2021-04-20 Thread Saq Imtiaz
Quick thought: (I wish the else op could somehow enclose a full expression directly in > the filter: "...else" ) > Use a filter run prefix. [... my first filter run..] :else[.. my other filter run...] -- You received this message because you are subscribed to the Google Groups