Almost all of my tiddlers have a list of external links at the bottom that relate to the tiddler. So, every time I create a tiddler, I write “See also:” followed by a list of external links.
My questions are:
I’d like to devise a method for conveniently entering those links if appropriate
One approach is to save links in fields, then create a view template to scan the current tiddlers fields and when finding fields who’s content begins http:// or https:// generate the external link. Using the field name as the link name.
I started work on a method to drop links on a tiddler, to create “link-n” fields you can then rename eg discussion. It looked great but had a little unpredictable behaviour, thus I have not published it.
I don’t use the email, only the interactive environment, but how did you reply?, from inside the email, or on the forum?. You may have done the correct thing and there is a change in talk.tiddlywiki
To get around this try an @ mention - like I do here @Surge
@Surge I looked around for a “complete” solution for this and I have a few in different states of development, each using one or more personal innovations.
However it seems they are all incomplete in one way or another.
Hopefully I can return with a finished package soon but here is a code snipit you can start with. Place in a tiddler tagged $:/tags/ViewTemplate
This will output each link as a bulleted item. There’s only one problem, if the link is of the format [[title|actual link]], the result is not rendered correctly (the [[) are eaten somewhere in the process as described in the docs on the enslist operator:
Literal filter operands cannot contain square brackets but you can work around the issue by using a variable. Learn more at:SetWidget documentation under the heading “Filtered List Variable Assignment”
However I can’t understand how to modify my code to fix that.
Otherwise it’s working! So I thought enlist eats up the [[]]] but apparently not since the let statement has access to them still. Can you shed some light on what the warning on the enlist operator exactly means?
Literal filter operands are text constant operand values surrounded by square brackets ([ and ]). In your code, has[links], split[|], nth[1], and nth[2] all use literal filter operands (“links”, “|”, “1”, and “2”, respectively). Note also that in your code, none of these literal filter operands contains any square brackets.
If we imagine that, in some other use-case, you wanted to split an item that contains an open square bracket ([), then you might be inclined to write something like split[[]… but that won’t work because, as the documentation says, “Literal filter operands cannot contain square brackets”. To avoid this limitation, you can first define a variable: <$let squarebracket="[">, and then use split<squarebracket> within the filter syntax.
In addition, there isn’t actually a need to use variable="link" in your $list widget. Instead, you could write just:
However, for code readability, it can be helpful to use variable="link" to make it clear exactly what is being referred to.
However, suppose that within the body of the $list widget you wanted to refer to the containing tiddler’s title. Then, using variable="link" is important, as it preserves the existing value of <<currentTiddler>>, while using <<link>> to refer to each enlisted item being processed by the $list widget.