List filter question

138 views
Skip to first unread message

David Gifford

unread,
Dec 19, 2015, 11:28:39 AM12/19/15
to TiddlyWiki
Hi all

I would like to create a list filter where for each tiddler:

1. you would see the tiddler's title.
2. But the tiddler title would be an external link to a relative filepath contained in a special field in that tiddler ("relativepath").

So the list results would turn up the equivalent of

[ext[Jeremy|../people/ruston.html]]

Use case: glossary of terms, where each definition is on a separate html page.

Been playing around but not getting anywhere.

Dave

David Gifford

unread,
Dec 19, 2015, 11:46:20 AM12/19/15
to TiddlyWiki
Well, I cheated and went with this:

1. <$list filter="[tag[bi]sort[title]]"><$view field="title"/> <$transclude field="relativepath" mode="inline"/></$list>

2. relativepath is set up like this: <a href="./path/filename.html">(go)</a>

But if someone has a better way to do this, where the title contains the external, relative link, please let me know.

Blessings

Dave

Eric Shulman

unread,
Dec 19, 2015, 12:41:53 PM12/19/15
to TiddlyWiki
You can use a macro to assemble the desired syntax
\define extlink(text,path) [ext[$text$|$path$]]

Put this definition into a separate tiddler, tagged with "$:/tags/Macro".
This makes the macro available for use in other tiddlers.

Then, use the $macrocall widget to invoke your macro using the values stored in the two separate fields, like this:
<$macrocall $name="extlink" text={{!!title}} path={{!!relativepath}} />

enjoy,
-e


David Gifford

unread,
Dec 19, 2015, 1:26:01 PM12/19/15
to tiddl...@googlegroups.com
Thanks Eric!

--
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/9PmTbR0OQG8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tiddlywiki+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/15ced3aa-0f07-4ffe-ab91-69e522bfa341%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
David Gifford
Christian Reformed World Missions, Mexico City

Tobias Beer

unread,
Dec 19, 2015, 1:55:42 PM12/19/15
to tiddl...@googlegroups.com
Hi Dave,
 
Then, use the $macrocall widget to invoke your macro using the values stored in the two separate fields, like this:
<$macrocall $name="extlink" text={{!!title}} path={{!!relativepath}} />
 
Alternatively, put it in a template, e.g.:

title: $://extlink

\define extlink(text,path) [ext[$text$|$path$]]
<$macrocall $name="extlink" text={{!!title}} path={{!!relativepath}} />

and then...

{{Jeremy||$://extlink}}

or just

{{||$://extlink}}

...in a list widget.

Best wishes,

Tobias.

David Gifford

unread,
Dec 19, 2015, 1:56:45 PM12/19/15
to tiddl...@googlegroups.com
Thanks Tobias!

--
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/9PmTbR0OQG8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tiddlywiki+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.

For more options, visit https://groups.google.com/d/optout.

David Gifford

unread,
Dec 20, 2015, 11:07:59 AM12/20/15
to tiddl...@googlegroups.com
Hi Tobias,

Using your macro, how would I remove the title of the current tiddler, which shows up above the list filter?

Dave

David Gifford

unread,
Dec 20, 2015, 11:10:58 AM12/20/15
to tiddl...@googlegroups.com
Never mind, I had put the macro in both the extlink tiddler AND the tiddler in which I put the macro. Fixed.

David Gifford

unread,
Dec 20, 2015, 11:11:38 AM12/20/15
to tiddl...@googlegroups.com
That is, I put the /define part in both.

Tobias Beer

unread,
Dec 20, 2015, 12:26:08 PM12/20/15
to tiddl...@googlegroups.com
Hi David,

Let me decipher this template for you once more...

title: $://extlink

\define extlink(text,path) [ext[$text$|$path$]]
<$macrocall $name="extlink" text={{!!title}} path={{!!relativepath}} />

Means: this will be a tiddler called $://extlink which contains the last two lines.

Then, in any other tiddler, you can do:

{{Jeremy||$://extlink}}

This will take the tiddler "Jeremy" and based on its title and relativepath field will create this extlink for you.

However, if you wanted to give this link a custom text, then this will not work for you, as you cannot pass parameters to a transclusion like you can pass them to a macro. At that point, you'd want to use a(nother) macro.

Tobias.

David Gifford

unread,
Dec 20, 2015, 4:19:55 PM12/20/15
to tiddl...@googlegroups.com
Hi, yes, I figured that out myself. Just that I had also put the /define line in the tiddler with the macro by mistake. But I got it fixed this morning. Works great. Thanks again!

Dave

On Sun, Dec 20, 2015 at 11:26 AM, Tobias Beer <beert...@gmail.com> wrote:
Hi David,

Let me decipher this template for you once more...

title: $://extlink

\define extlink(text,path) [ext[$text$|$path$]]
<$macrocall $name="extlink" title={{!!title}} path={{!!relativepath}} />

Means: this will be a tiddler called $://extlink which contains the last two lines.

Then, in any other tiddler, you can do:

{{Jeremy||$://extlink}}

This will take the tiddler "Jeremy" and based on its title and relativepath field will create this extlink for you.

However, if you wanted to give this link a custom text, then this will not work for you, as you cannot pass parameters to a transclusion like you can pass them to a macro. At that point, you'd want to use a(nother) macro.

Tobias.

--
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/9PmTbR0OQG8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tiddlywiki+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.

For more options, visit https://groups.google.com/d/optout.

David Gifford

unread,
Dec 20, 2015, 4:20:55 PM12/20/15
to tiddl...@googlegroups.com
Here is the static I created as a result

http://recursos.giffmex.org/glosario.interpretacion.html

Dave

ih...@newsfromgod.com

unread,
Dec 21, 2015, 4:49:57 AM12/21/15
to tiddl...@googlegroups.com
Hi,

Quoting Tobias Beer <beert...@gmail.com>:

> Hi David,
>
> Let me decipher this template for you once more...
>
> title: $://extlink
>
> \define extlink(text,path) [ext[$text$|$path$]]
> <$macrocall $name="extlink" title={{!!title}} path={{!!relativepath}} />
>
I think you meant:
<$macrocall $name="extlink" text={{!!title}} path={{!!relativepath}} />
^^^^^
Right? (text instead of title, because the Macro parameter is named "text")

Thanks


Tobias Beer

unread,
Dec 21, 2015, 5:19:37 AM12/21/15
to tiddl...@googlegroups.com, ih...@newsfromgod.com
Hi ihm4u,
 
I think you meant:
<$macrocall $name="extlink" text={{!!title}} path={{!!relativepath}} />
                             ^^^^^
Right? (text instead of title, because the Macro parameter is named "text")

Yes, will edit the above. Thx. :-)

Best wishes,

Tobias.
Reply all
Reply to author
Forward
0 new messages