-
I have a widget that will hide a section of text based on, among other things, the presense of the tag "$:/tags/twsr/hideAnswers" I do this in javascript with:
But this is inadequate for the case where the widget is brought in via a list. see second tiddler here: http://welford.github.io/ruby.html Is there a way i can make this work? get the tags for the actual tiddler being rendered and not whatever currentTiddler is here. Thanks, |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 5 replies
-
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?
|
Beta Was this translation helpful? Give feedback.
-
Hi, .. I don't understand, why you hardcode a tag in a widget?! ... IMO that's bad practice. Every parameter, that changes the behaviour of a widget should be a real parameter. |
Beta Was this translation helpful? Give feedback.
-
I think the original question is also a problem of missing parameters. .. If a widget needs a "tiddler" parameter it needs to have a "parameter", otherwise you will get the problems that you have now. The list widget has a
Your IMO you should really think about to get your parameters fixed. |
Beta Was this translation helpful? Give feedback.
-
The closest widget I can think of is the reveal-widget. .. So if you have a closer look at the reveal-widget code, you can see, how it handles parameters. The other and much more complex widget that may be interesting is the "button-widget" .. BUT it's code is a mess since it does much more things as it should ... |
Beta Was this translation helpful? Give feedback.
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?