I have a fast growing wiki with many tiddlers tagged “draft”. I would like to make this status visible in the TOC by giving them another style rule e.g. opacity: 0.5 or sth. like that.
Is it possible to filter the TOC entries and add such a rule? How could I accomplish this? Thanks for any advice!
To change this definition, you do NOT need to modify the TWCore shadow tiddler. Instead, just paste the above macro definition into a new tiddler (e.g., “MyTOCCaption”), and tag that tiddler with $:/tags/Global.
Then, to add your desired CSS style rule, you can modify that copy of the macro definition by changing this line:
Within the TOC code, the currentTiddler variable is used to refer to each TOC item being rendered
The added style=... attribute uses a “filtered transclusion” (the triple curly syntax) to see if the currentTiddler is tagged with “draft” and, if it is, it applies the opacity:0.5 style to the TOC item output.
Thank you, Scott, I’ve tried your solution but couldn’t get it to work. Double-checked everything but the styles are not applied. Neither is the class when I look it up in the inspector window. I’d prefer styling this way because I already have a stylesheet in my wiki for extra styling. Do you have any idea what could be wrong?
Did you follow the rest of @Eric’s suggestion, making sure that the tiddler with the new toc-caption code has the tag $:/tags/Global?
Did you try my attachment? You should be able to click on it to download and simply drag the file onto your wiki. But note that this one and the one from Eric are not compatible. If they’re both there, then his might override mine, which might be the issue.
Also, what version of TW are you using? If it’s older than 5.3.0, then the Substituted Attribute Values syntax wouldn’t be available.
If none of those answers the question, do you have a public wiki we could try this on?
It’s not quite the TOC, but feels aligned to the original request nonetheless - for making the Draft tids (actual being-edited drafts, not tagged drafts) stand out in the ‘Open’ list, this thread offers a pure CSS solution: Making Drafts stand out in the Open sidebar - #3 by nemo
regarding tagged stuff - I use a “TODO” tag which feels aligned to OP’s use of ‘draft’, and for that I have a tid which generates a TOC just for that tag: