$reveal not work as expected

I want to display “done” (or prettier, a symbol) after the title in a list, if it has a tag “done”, code as below:

<$list filter="[tag[some-tag]sort[title]reverse[]]">
  <div>
    <$link to={{!!title}}>
      <$view field="title" />
    </$link>
    <$reveal type="match" tag="done">
      dddd
    </$reveal>
  </div>
</$list>

Although the tiddler has a tag “done”, “dddd” doesn’t show.
If replace “match” by “nomatch”, it shows.
What’s the problem?

Please closely read the docs. The tag parameter of the reveal widget defines the HTML tag like DIV or SPAN, not the tiddler tag.

In this case using the conditional syntax would make more sense.

The following code can be tested at tiddlywiki.com

<$list filter="[tag[task]!sort[modified]]">
  <div>
    <$link to={{!!title}}>
      <$view field="title" />
    </$link>
    <% if [<currentTiddler>tag[done]]%>
      done
    <% endif %>
  </div>
</$list>
1 Like

Thanks

BTW it is the grammar that I’m finding, I’ve tried to find such grammars for several minitues, but not find it.
Where are the docs for such grammars?

Yea – that’s a bit of a problem. The HTML spec also talks about TAGs when it refers to html elements.

See: HTML elements reference - HTML: HyperText Markup Language | MDN

I am not sure, how / where we can add this info in the TW docs. – Need to think about it.

Edit: I did create a PR at GitHub to slightly improve the docs. Second PR with new Tags and Title tiddlers

1 Like

I’ve checked there, but no grammar for codes like

<% if [<currentTiddler>tag[done]]%>
  done
<% endif %>

see https://tiddlywiki.com/#Conditional%20Shortcut%20Syntax

1 Like

Since if is a two-letter word, search results on tiddlywiki.com may not be accurate. A search on %if however does retrieve https://tiddlywiki.com/#Conditional%20Shortcut%20Syntax.

1 Like

Are there any complete guide for the grammar?
I need to learn it systematically?

You may start with Wikitext and Widgets

  • Wikitext covers the basics
  • Widgets are the building blocks for advanced functionality.

I did create a Wikitext Cheatsheet plugin, that may be interesting. You can install it into your wiki if you need to.

It can also be installed into tiddlywiki.com because there is no restart required. So you can use it there too.

2 Likes

Great, thanks very much.