I am trying to make my backlinks display more intelligent, in so far that only display links if the result from the backlinks operator is gt 0. I realise that I am trying to be too clever in that the TLSdisplaylinks procedure will only be invoked on a non empty list. However, that still does not explain the result from the compare operator.
With no comparison, the result is (ie. backlinks on its own matches my code result).
Now we add the compare operator code.
<!-- extracts backlinks from the current tiddler -->
\procedure TLSbacklinks()
Linked from
<br>
<!--only used for debugging
<<list-links filter:"[all[current]backlinks[]]" >>
-->
<<list-links filter:"[all[current]backlinks[]]" >>
<$list filter="[all[current]backlinks[]compare:number:gt[0]]" >
<<TLSdisplaylinks>>
</$list>
\end
Using the above code, the result is missing the entries after Carriages

If I change the code to, removing the text ‘number:’
<!-- extracts backlinks from the current tiddler -->
\procedure TLSbacklinks()
Linked from
<br>
<!--only used for debugging
<<list-links filter:"[all[current]backlinks[]]" >>
-->
<<list-links filter:"[all[current]backlinks[]]" >>
<$list filter="[all[current]backlinks[]compare:gt[0]]" >
<<TLSdisplaylinks>>
</$list>
\end
the result is now missing the first three entries, before Fort Glanville
If I insert the missing : in the compare statement, the result is the same as the first result, entries after Carriages is missing.
NB: I display the result from using just a plain backlinks operator call to allow comparison with what should be displayed from my call.
I can’t explain this result.
For your information, TLSdisplaylinks is (and tis works correctly)
<!--displays the links depending on tiddler type, from the supplied list of tiddlers -->
\procedure TLSdisplaylinks()
<% if [<currentTiddler>prefix:title[MGA]caption[History]] %>
<$link to=<<currentTiddler>> >
History: <$text text={{{ [<currentTiddler>get[parentGun]get[caption]] }}}/>
</$link>
<br>
<% elseif [<currentTiddler>prefix:title[MGA]caption[Local History]] %>
<$link to=<<currentTiddler>> >
LocalHistory: <$text text={{{ [<currentTiddler>get[parentGun]get[caption]] }}}/>
</$link>
<br>
<% elseif [<currentTiddler>prefix:title[MGA]caption[Gallery]] %>
<$link to=<<currentTiddler>> >
Gallery: <$text text={{{ [<currentTiddler>get[parentGun]get[caption]] }}}/>
</$link>
<br>
<% elseif [<currentTiddler>prefix:title[MGA]caption[Technical]] %>
<$link to=<<currentTiddler>> >
Technical: <$text text={{{ [<currentTiddler>get[parentGun]get[caption]] }}}/>
</$link>
<br>
<% elseif [<currentTiddler>prefix:title[MGA]caption[Map]] %>
<$link to=<<currentTiddler>> >
Map: <$text text={{{ [<currentTiddler>get[parentGun]get[caption]] }}}/>
</$link>
<br>
<% elseif [<currentTiddler>tag[All Guns]] %>
<$link to=<<currentTiddler>> >
All Guns: <$text text={{!!caption}} />
</$link>
<br>
<% elseif [<currentTiddler>tag[Gun Type]] %>
<$link to=<<currentTiddler>> >
Gun Type: <$text text={{!!title}} />
</$link>
<br>
<% elseif [<currentTiddler>tag[Fort]] %>
<$link to=<<currentTiddler>> >
Fort: <$text text={{!!title}} />
</$link>
<br>
<% elseif [<currentTiddler>tag[Ship]] %>
<$link to=<<currentTiddler>> >
Ship: <$text text={{!!title}} />
</$link>
<br>
<% elseif [<currentTiddler>tag[Manufacturer]] %>
<$link to=<<currentTiddler>> >
Manufacturer: <$text text={{!!title}} />
</$link>
<br>
<% elseif [<currentTiddler>caption[Ammunition]] %>
<$link to=<<currentTiddler>> >
Ammunition: <$text text={{!!title}} />
</$link>
<br>
<% elseif [<currentTiddler>caption[Carriages]] %>
<$link to=<<currentTiddler>> >
Carriages: <$text text={{!!title}} />
</$link>
<br>
<% endif %>
\end
Any ideas?
bobj


