What is the purpose of source field in a tiddler?

123 views
Skip to first unread message

talha131

unread,
Sep 6, 2020, 4:28:34 PM9/6/20
to TiddlyWiki

As per the docs:

source is field is used by the core for

The source URL associated with a tiddler

Is there a practical example of it being used?

What I am looking for?

I want to add a field that can be used for links to the source of the tiddler. Say I copy the content from Wikipedia and I want to mention the link the Wikipedia article.

Can I use source field for it? Or should I add a new field like url?

I can then customize ViewTemplate to automatically show the source url in the body of the tiddler. But which field should I use?

talha131

unread,
Sep 6, 2020, 5:17:57 PM9/6/20
to TiddlyWiki

Though I could not find official documentation, but it seems source field has special usage in TW.

For example, this edition uses source field for creating a hierarchy of tiddlers.

http://tw5.scholars.tiddlyspot.com/

It is also used for the source URL of a plugin.

(optional) Source URL of plugin

https://tiddlywiki.com/static/Plugin%2520Fields.html

My understanding is that it is better to avoid source and use some other custom field for my use case.

Do let me know if my understanding is incorrect.

TW Tones

unread,
Sep 7, 2020, 1:51:10 AM9/7/20
to TiddlyWiki
This answer lays with yourself.

Perhaps fine if your not editing the plugin Tiddler.

However can I suggest source-link

The reason is you could then write wiki text to turn the contents of any field name with -link into a link by the prefixes name

E.g. source is the title of a link stored in source-link

Perhaps a nice little defacto standard
Tony

PMario

unread,
Sep 7, 2020, 3:38:07 AM9/7/20
to TiddlyWiki
Hi,
There is only 1 field that you have to use to create a valid tiddler. The "title". That's it.

Every other field name is just a convention. https://tiddlywiki.com/#TiddlerFields shows all fields that are used by core tiddlers.

As far as I know, It's OK to use source. Especially as you want to use it in the exact way as it is described.

I'll have a closer look at the core code but I'm pretty sure there is no side effect.

-mario

TiddlyTweeter

unread,
Sep 7, 2020, 4:10:16 AM9/7/20
to tiddl...@googlegroups.com
talha131 and PMario

"source" is fine to use as you need in most tiddlers. It has special meaning, I believe, in plugins only (PMario?)

The TW ADVICE is ... 

source = The source URL associated with a tiddler

You can interpret this liberally. For instance, I have used it not for URLs, but book title references with no link.

Best wishes
TT

talha131

unread,
Sep 9, 2020, 1:32:31 PM9/9/20
to TiddlyWiki

Thank you all.

The reason is you could then write wiki text to turn the contents of any field name with -link into a link by the prefixes name

Great tip.

I decided to use source-url, source-book, source-person, depending on from where I collected the note.

Reply all
Reply to author
Forward
0 new messages