I am looking at how, when using the backlinks operator, I can get the caption returned instead of the tiddler’s title.
I have foubnd the shadow tiddler,
$:/core/modules/filters/backlinks.js
/*\
title: $:/core/modules/filters/backlinks.js
type: application/javascript
module-type: filteroperator
Filter operator for returning all the backlinks from a tiddler
\*/
(function(){
/*jslint node: true, browser: true */
/*global $tw: false */
"use strict";
/*
Export our filter function
*/
exports.backlinks = function(source,operator,options) {
var results = new $tw.utils.LinkedList();
source(function(tiddler,title) {
results.pushTop(options.wiki.getTiddlerBacklinks(title));
});
return results.makeTiddlerIterator(options.wiki);
};
})();
but I am unsure of how to amend the code without stuffing things up.
Could someone advise please?
On a more general note, is it possible to have a flag everytime a tiddler’s title is returned so that the caption is returned if the flag is set? There are a few core functions that already return caption if one is available. Why not extend this function everywhere?
bobj
bobj