Minor problem using tag-pill macro to implement tag picker from tagcloud?

Hi,

I need a tag picker to select a tag from a LONG list of tags and decide to use a more compressed tagcloud instead of a selection list tag picker. The tag-pill macro example from Eric in this post did the trick for me : https://groups.google.com/g/tiddlywiki/c/-jpFgTDJBd8/m/5d5byf0aAwAJ

There is a minor problem : Display of each tag pill has a preceding quotation mark. This seems to come from within the tag-pill macro.

Would like to seek advice on how to remove it. Buttons instead of tag-pill macro work equally well except I have no idea how to style a button to look like a tag pill.

My codes:

title: Tag Menu
text:
\define tv-wikilinks() no
Tag :  <$edit-text tiddler="Tag Menu" field="selection" default="" size="30"/>
<$reveal type="nomatch" state="$:/state/tagpickerState" text="show">
   <$button set="$:/state/tagpickerState" setTo="show">Select</$button>
</$reveal>
<$reveal type="match" state="$:/state/tagpickerState" text="show">
   <$button set="$:/state/tagpickerState" setTo="hide">Select</$button>
{{tagpicker}}
</$reveal>

---

title: tagpicker
text:
\define actions() '<$action-setfield $tiddler="Tag Menu" selection=<<__tag__>>/><$action-setfield $tiddler="$:/state/tagpickerState" text="hide"/>'
<$list filter="[tags[]!is[system]sort[title]]" variable="currentTag" >
<$macrocall $name="tag-pill" element-tag="$button" tag=<<currentTag>> actions=<<actions>>/><$count filter="[<currentTag>tagging[]]"/>&nbsp;
</$list>

Thanks in advance !

I doubt this comes from the tag macro, unless you mean a modified one,

Why is the \define actions wrap the action widget in backticks, this does not look right, not the same as Eric’s. @EricShulman example is from google groups and is two and a half years old. Can you ask the question a fresh, we may have a better answer.

The problem originates with the line:

\define actions() '<$action-setfield $tiddler="Tag Menu" selection=<<__tag__>>/><$action-setfield $tiddler="$:/state/tagpickerState" text="hide"/>'

which has unneeded single quotes surrounding the $action widgets, which results in those TWO single quotes being shown in the tag pill display. Remove those single quotes, like this:

\define actions() <$action-setfield $tiddler="Tag Menu" selection=<<__tag__>>/><$action-setfield $tiddler="$:/state/tagpickerState" text="hide"/>
4 Likes

Yes, that tagged it ! Thanks, twice !!

I guess both of you spotted the mistake right away with your experienced eyes :grinning_face_with_smiling_eyes: Yes, the actions macro is modified by me which didn’t work. Eric’s example works perfectly well, and is also the only example I could find so far for tag-pill macro, for which I’m thankful.

Thanks, guys!

1 Like