Thanks Jed,
That works very well, I think I will get it to float right of the current
tags in the view template. Wrapped to show only if there is a tiddler
tagged with the current tiddlers title.
<$list filter="[all[current]tagging[]limit[1]]" variable=null >
<<tag Here>>
</$list>
- Its great that the tag color comes through
- Tag pils can be presented with a fixed length despite underlying name,
allowing smarter presentation
However I also see other uses. I have a set of tags which have a suffix eg
action-wip action-done, with action or task as examples of the prefix.
It is now possible to provide a tag pill for wip and done irrespective of
what the prefix is,
Thanks for stepping int to help.
I see real value having this in the core.
Regards
Tony
On Thursday, November 16, 2017 at 12:07:23 AM UTC+11, Jed Carty wrote:
>
> Sorry, I copied the wrong thing into the post. The macro at the end was
> named tagLabel instead of just tag. Here is the fixed version, it just has
> the marco name changed:
>
>
> \define tag-pill-styles()
> background-color:$(backgroundColor)$;
> fill:$(foregroundColor)$;
> color:$(foregroundColor)$;
> \end
>
> \define
> tag-pill-inner(tag,icon,colour,fallbackTarget,colourA,colourB,element-tag,element-attributes,actions)
> <$vars foregroundColor=<<contrastcolour target:"""$colour$"""
> fallbackTarget:"""$fallbackTarget$""" colourA:"""$colourA$"""
> colourB:"""$colourB$""">> backgroundColor="""$colour$""">
> <$element-tag$ $element-attributes$ class="tc-tag-label tc-btn-invisible"
> style=<<tag-pill-styles>>>
> $actions$<$transclude tiddler="""$icon$"""/> <$list
> filter='[{$:/core/macros/tag!!someemptyfield2}!prefix<LABEL>]'
> emptyMessage='<$view tiddler="""$tag$""" field="title" format="text" />'
> variable='dummy'><<LABEL>></$list>
> </$element-tag$>
> </$vars>
> \end
>
> \define
> tag-pill-body(tag,icon,colour,palette,element-tag,element-attributes,actions)
> <$macrocall $name="tag-pill-inner" tag="""$tag$""" icon="""$icon$"""
> colour="""$colour$""" fallbackTarget={{$palette$##tag-background}}
> colourA={{$palette$##foreground}} colourB={{$palette$##background}}
> element-tag="""$element-tag$"""
> element-attributes="""$element-attributes$""" actions="""$actions$"""/>
> \end
>
> \define tag-pill(tag,element-tag:"span",element-attributes:"",actions:"")
> <span class="tc-tag-list-item">
> <$macrocall $name="tag-pill-body" tag="""$tag$""" icon={{$tag$!!icon}}
> colour={{$tag$!!color}} palette={{$:/palette}}
> element-tag="""$element-tag$"""
> element-attributes="""$element-attributes$""" actions="""$actions$"""/>
> </span>
> \end
>
> \define tag(tag label)
> <$set name=LABEL value="""$label$""">
> {{$tag$||$:/core/ui/TagTemplate}}
> </$set>
> \end
>
>
>
--
You received this message because you are subscribed to the Google Groups
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit
https://groups.google.com/d/msgid/tiddlywiki/b145db71-34c9-4b4c-a3f6-48b47c29cfc2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.