mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-01-11 18:00:26 +00:00
Added indirect transclusion
The name of the tiddler to transclude is taken from a text reference
This commit is contained in:
parent
bdc46a8bc3
commit
34435329e6
@ -56,6 +56,7 @@ exports.info = {
|
|||||||
cascadeParams: true, // Cascade names of named parameters to following anonymous parameters
|
cascadeParams: true, // Cascade names of named parameters to following anonymous parameters
|
||||||
params: {
|
params: {
|
||||||
target: {byName: "default", type: "tiddler"},
|
target: {byName: "default", type: "tiddler"},
|
||||||
|
targetVia: {byName: true, type: "tiddler"},
|
||||||
template: {byName: true, type: "tiddler"},
|
template: {byName: true, type: "tiddler"},
|
||||||
templateText: {byName: true, type: "text"},
|
templateText: {byName: true, type: "text"},
|
||||||
"with": {byName: true, type: "text", dependentAll: true}
|
"with": {byName: true, type: "text", dependentAll: true}
|
||||||
@ -73,6 +74,12 @@ exports.evaluateDependencies = function() {
|
|||||||
} else {
|
} else {
|
||||||
dependencies.addDependency(template,true);
|
dependencies.addDependency(template,true);
|
||||||
}
|
}
|
||||||
|
var targetVia = this.srcParams.targetVia;
|
||||||
|
if(typeof targetVia === "function") {
|
||||||
|
dependencies.dependentAll = true;
|
||||||
|
} else {
|
||||||
|
dependencies.addDependency(targetVia,true);
|
||||||
|
}
|
||||||
return dependencies;
|
return dependencies;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -85,6 +92,8 @@ exports.executeMacro = function() {
|
|||||||
// If there's no render title specified then use the current tiddler title
|
// If there's no render title specified then use the current tiddler title
|
||||||
if(this.hasParameter("target")) {
|
if(this.hasParameter("target")) {
|
||||||
renderTitle = this.params.target;
|
renderTitle = this.params.target;
|
||||||
|
} else if(this.hasParameter("targetVia")) {
|
||||||
|
renderTitle = this.wiki.getTextReference(this.params.targetVia,null,this.tiddlerTitle);
|
||||||
} else {
|
} else {
|
||||||
renderTitle = this.tiddlerTitle;
|
renderTitle = this.tiddlerTitle;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user