How to add rider macro into the Listitemtemplate

I was trying to add the rider macro from the rider plug in by @clutterstack into a custom listitemtemplate.
The purpose is to add in-place editing capability to the backlinks section.

So I cloned the $:/core/ui/TiddlerInfo/References to create a custom backlinks section with code as given below

\define lingo-base() $:/language/TiddlerInfo/
<$list filter="[all[current]backlinks[]sort[title]]" emptyMessage=<<lingo References/Empty>> template="Styled Listtemplate for backlinks">
</$list>

Code within the Styled Listtemplate for backlinks tiddler is

\whitespace trim
<div style="clear:both;">
</div>
<div class="tc-tagged-bylm">

<details><summary>{{||tKwm}}</summary>
<<rider "text">>
</details>

But this line in the code <<rider "text">> doesn’t seem to work. How to correct it?

I have made a demo here with relevant tiddlers in the home page

@arunnbabu81 the first note is the rider plugin does not need the fieldname “text” but the tiddler name of the tiddler you want to transclude/edit.

Al;sop when using macros and passing parameters using macrocall instead gives you more control;

<$macrocall $name=rider tiddler="Tiddlername"/>

So above you can replace “Tiddlername” with field, variable and macros.

It’s a good idea what you are doing so I did something similar to what you asked

  • I found riders own state tiddler would be included so I have excluded tiddlers with its prefix.
  • I made a second tab with edit icon next to the existing references tab.
  • A little styling for “rider” needs to be done to stop the items overlapping.

Edit-backlinks-references-info-tab.json (741 Bytes)

1 Like

Thank you @TW_Tones for the help. I have updated my demo wiki based on your suggestion. I am still trying to make it better. Would love to add context highlighting also into this. Have to look at similar implementations and try my luck in the coming days.

1 Like

I tried to add context highlighting based on a similar viewtemplate by @DaveGifford (which I have included in the demo for comparison)

But my experiment is not working

Here is the code i tried

\define lingo-base() $:/language/TiddlerInfo/
<$vars searchme=<<currentTiddler>> searchspx={{{ [<currentTiddler>escaperegexp[]]}}} >

<details><summary>References with inline editing and context</summary>
<$list filter="[all[current]backlinks[]sort[title]!prefix[$:/state/can/rider/]]" emptyMessage="" variable=tiddlername>
<div style="clear:both;">
</div>
<div class="tc-tagged-bylm">
<$macrocall $name=rider tiddler=<<tiddlername>> $context term=<<searchme>>/>


Here is the link for demo wiki

For starters, your version of my $:/.giffmex/Viewtemplate/Backlinks/HighlightsContext doesn’t have the closing details tag. That may be my mistake. That’s not from Stroll or my Documenting TW file online. Where did you get that from, so I can check my version and correct it?

Also your code snippet lacks the closing </details> as well, and lacks the closing vars tag.

1 Like

I took it from CustomizerPlugin — Reimagining TiddlyWiki

Details tag was not there in your code I guess. I added it from making all references looks similar. I was doing this in my mobile. So I might have missed the closing tags. Will update it when I am back on my desktop.