Is there a way I could create a field that stores a list of the links its tiddler has? I know that there is a filter available (links[]) that can do this if I wanted to create a filter run, but what if I wanted to have each tiddler have a designated field with the values?
You could use an action set field widget inside a button to set a field to any value you want and if you have a list of tiddlers in a variable use that as the value.
- I will try and give you some sample code later today
However it all depends on what you want todo with this field in the long run. For example if you want to add additional tiddlers to this list you will need to use action listops or append titles to your list.
All I want is just to autopopulate the field with the links contained in the tiddler. But is there any way to do this automatically and not have to click a button?
When do you want this to happen? Only on wiki load? Whenever the wiki is saved? On every keystroke?
When I save a tiddler! So if I have a tiddler with the following in the text:
“America was founded in [[1492|15thCentury]] by [[ChristopherColumbus]]”
I would want a field (let’s say it’s called “links”) that would populate with “15thCentury ChristopherColumbus” when I save the tiddler.
I suppose the next question is why?
As soon as you create the links they can be found as links in the text field and as missing links. So maybe you dont need to add them to a field.
- Why also place them in another field?
- perhaps you have a reason so please tell us.
Tools like relink can find them if you rename the resulting tiddler.
- Do you want to do this for all links in all tiddler s?
We can arrange a couple of ways such as add special actions to the save button, create an editor toolbar button, to add links that also stores the title in a field or even setup a batch process to do it for bulk tiddlers.
- but then devil is always in the details. You need to answer some of the questions we have asked if none of those posibilities is made.
All off the above posibilities exist but require some effort but in some ways add no additional information to your wiki so perhaps explain why you are doing it and what you expect the final result to be any there may be any easier approach.
Just a quick note to cause a change to a tiddler or field you need some kind of trigger such as a button, including existing ones but when you chose one it will do it every time you trigger it. Eg always in save tiddler.
@switchplayer have you tried using the chain link icon in the Editor Toolbar? It can be used to search for and create a link to an existing tiddler, and I just discovered non existing tiddlers. That could be modifield to also add such links entered that way into a list field.
- But still what is the bigger picture?
See here Tonys Tiny Tips - using the editor toolbar link button for more