Changing the colors of tagged tiddlers

68 views
Skip to first unread message

Steven Schneider

unread,
Aug 26, 2016, 4:35:51 PM8/26/16
to TiddlyWiki
...I don't often write things that the group might find useful (I'm a taker here, not as much a giver). But today, I wrote a quick utility to check/change the colors of tagged tiddlers to match the tiddler to which they are tagged.  Might be helpful for those who use colors to differentiate different types of tags. Hard-coded to check tiddlers tagged with "Dimensions" now, but easy to change. 

Enjoy!

<!--get list of dimensions-->
Dimensions: <$select tiddler='$:/generated-list-selected-dimension'>
<$list filter='[tag[Dimensions]]'>
<option value=<<currentTiddler>>><$view field='title'/></option>
</$list>
</$select>

<!-- get the color of a tag for a tiddler -->
<$list filter="[title{$:/generated-list-selected-dimension}]">
<$macrocall $name="tag" tag={{$:/generated-list-selected-dimension}}/><br>
<$set name="color" value={{!!color}}>
<!--get all the tiddlers tagged-->
<$list filter="[tag{!!title}]">
<$macrocall $name="tag" tag=<<currentTiddler>>/>
<$button>change the color
<$action-setfield color=<<color>> /> </$button><br>
</$list>


Tobias Beer

unread,
Aug 27, 2016, 12:57:08 PM8/27/16
to tiddl...@googlegroups.com
Hi Steve,

Useful stuff.

For ColoresLinksPlugin for TW Classic I implemented it once so that
tiddlers would automatically be shown in the color of the first tag.

Some polishing for your example:

<$vars categories="[tag[TableOfContents]]">
<$select tiddler='$:/temp/set-tag-color'>
<$list filter=<<categories>>>
<option value=<<currentTiddler>>><$view field='title'/></option>
</$list>
</$select>
</$vars>

<$list filter="[{$:/temp/set-tag-color}]">
<$vars color={{!!color}}>
<!--set all of category-->
<$button>change all tagged:
<$list filter="[tag{$:/temp/set-tag-color}]">
<$action-setfield color=<<color>> />
</$list>
</$button>
<$edit field="color"/>
<$macrocall $name="tag" tag={{$:/temp/set-tag-color}}/>
<br><br>
<!--get all the tiddlers tagged-->
<$list filter="[tag{!!title}]">
<$button>change color for:
<$action-setfield color=<<color>> /> </$button>
<$edit field="color"/>
<$macrocall $name="tag" tag=<<currentTiddler>>/>
<br>
</$list>
</$vars>
</$list>

Best wishes,

Tobias.
Reply all
Reply to author
Forward
0 new messages