mirror of
https://github.com/TiddlyWiki/TiddlyWiki5.git
synced 2026-04-29 03:56:39 +00:00
Initial support for switching page templates (#4979)
* Add support for switching page templates
* Revert "Add support for switching page templates"
This reverts commit dbf7682d47.
* Adopt Jeremy's approach to page template switching instead
* Fix default value of recursion marker
* Fixed issue with conditional check
This commit is contained in:
@@ -43,6 +43,7 @@ TranscludeWidget.prototype.execute = function() {
|
||||
this.transcludeField = this.getAttribute("field");
|
||||
this.transcludeIndex = this.getAttribute("index");
|
||||
this.transcludeMode = this.getAttribute("mode");
|
||||
this.recursionMarker = this.getAttribute("recursionMarker","yes");
|
||||
// Parse the text reference
|
||||
var parseAsInline = !this.parseTreeNode.isBlock;
|
||||
if(this.transcludeMode === "inline") {
|
||||
@@ -61,7 +62,9 @@ TranscludeWidget.prototype.execute = function() {
|
||||
parseTreeNodes = parser ? parser.tree : this.parseTreeNode.children;
|
||||
// Set context variables for recursion detection
|
||||
var recursionMarker = this.makeRecursionMarker();
|
||||
this.setVariable("transclusion",recursionMarker);
|
||||
if(this.recursionMarker === "yes") {
|
||||
this.setVariable("transclusion",recursionMarker);
|
||||
}
|
||||
// Check for recursion
|
||||
if(parser) {
|
||||
if(this.parentWidget && this.parentWidget.hasVariable("transclusion",recursionMarker)) {
|
||||
|
||||
Reference in New Issue
Block a user