Trying to make list-links macro display other field

Hi all,

I want the macro list-links to display the title field, even if tiddlers have a caption field. The docu says you can use the parameter ‘caption’ for this (no example unfortunately). But it does not work.
My code:

<<list links filter:"…no problem here…" caption:“title”>>

What am I doing wrong?

Greetings,
Sjaak

The docs say the list-links macro has a field parameter that defaults to caption. I would think you can simply explicitly give title as the argument, like so:

<<list-links filter:'...' field:title >>

3 Likes

@SjaakA remember the list-links macro is a convenient macro for general use, it is coded here $:/core/macros/list. Its the first at the top. You could copy this and make you own (give it a new name).

But a more common approach is to build the same functionality using the ListWidget which you can build more on later.

  • The content of the list widget is the template (ie between <$list and </$list>, which is where you can choose to display whatever you want for each list item, but you could use the template parameter to name an external tiddler containing the template.
  • In fact leave it empty and you get a simple list that uses the title/current tiddler.
1 Like

It turns out your suggestion works, BUT I had to upgrade my wiki from version 5.1.21 to make it work. So apparently there was a bug in the macro that was fixed since that version.

Also, since 5.2.5. the text in the docs about <> has changed. I know that because I once put the home wiki version on disk, in order to avoid downloading the entire wiki each time I want to look something up online. The text about <> there says that the parameter to change the name of the field to transclude (default caption) is called ‘caption’. The current version (5.2.7.) says it is called ‘field’, which of course does make more sense.

Lesson learned: upgrade more often, especially when encountering strange behaviour!

1 Like

Ohh 5.1.21 is old - I’d guess it was probably more a “missing feature” at that time, than a “bug”.

Note that this forum software requires you to put angle brackets within ticks. But I think I understand you talk about the <<list-links>> macro :slight_smile:

Is there a page of these conventions? I can not find it in the About or FAQ sections.

Not sure. But, specifically, the “ticks” I refer to that are needed around code, is what you get in the editor from the button with this icon: </>

Fyi you can edit someones or your own post to insert or wrap code using the code button or the same as tiddlywiki, single or tripple backticks. @sjaakA

1 Like