Skip to content
Discussion options

You must be logged in to vote

Went with something like this, traverse parent widgets and pick up all tags along the way, would be nice if i could pick out the container widget that actually is showing though. Is there a way to do this?

var p = this;
var tags = [];
while(p){
	var ct = p.getVariable("currentTiddler");
	var tid = $tw.wiki.getTiddler(ct);
	if(tid){
		tags = tags.concat(tid.getFieldList("tags"));
		tags = tags.filter(function(item, pos) {	return tags.indexOf(item) == pos; })
	}
	p = p.parentWidget;
}

Replies: 4 comments 5 replies

Comment options

You must be logged in to vote
3 replies
@pmario
Comment options

pmario Jul 26, 2021
Collaborator

@welford
Comment options

@pmario
Comment options

pmario Jul 26, 2021
Collaborator

Answer selected by welford
Comment options

You must be logged in to vote
2 replies
@welford
Comment options

@pmario
Comment options

pmario Jul 26, 2021
Collaborator

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants