Reveal content based on field content

268 views
Skip to first unread message

Danielo Rodríguez

unread,
Dec 13, 2016, 1:12:59 PM12/13/16
to TiddlyWiki
Hello,

I'm struggling my mind trying to realize how can I use the reveal widget to show or hide content based on the value of a tiddler field or even the absence of that field.

Documentation says that I can use text references in the reveal widget, but it does not work.

Regards

Jeremy Ruston

unread,
Dec 13, 2016, 1:26:27 PM12/13/16
to tiddl...@googlegroups.com
Hi Danielo

Can you show what you've tried? Did the examples on tiddlywiki.com help?

Best wishes

Jeremy

--
Jeremy Ruston
jer...@jermolene.com
http://jermolene.com
> --
> 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 tiddlywiki+...@googlegroups.com.
> To post to this group, send email to tiddl...@googlegroups.com.
> 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/9cfa3465-d5a3-432a-a949-39ff4d2b1764%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Jed Carty

unread,
Dec 13, 2016, 1:26:33 PM12/13/16
to TiddlyWiki
This works on tiddlywiki.com:

<$reveal type='match' state='!!bob' text='eddie'>
Hi!
</$reveal>

If you put that in a tiddler it won't show anything unless the tiddler has a field called 'bob' with the content 'eddie'

HansWobbe

unread,
Dec 13, 2016, 3:12:07 PM12/13/16
to TiddlyWiki
Jed:

Thank you very much for this  elegant little snippet.  In spite of thinking of myself as a bit of a power User, I am always amazed at just how much I haven't thought of, or have yet to realize.  This is a nest example that is a good reminder for me.

Thanks again for all of your contributions to this group.

Hans

Danielo Rodríguez

unread,
Dec 13, 2016, 3:24:18 PM12/13/16
to TiddlyWiki


El martes, 13 de diciembre de 2016, 21:12:07 (UTC+1), HansWobbe escribió:
Jed:

Thank you very much for this  elegant little snippet.  In spite of thinking of myself as a bit of a power User, I am always amazed at just how much I haven't thought of, or have yet to realize.  This is a nest example that is a good reminder for me.

Thanks again for all of your contributions to this group.

Hans

I have to subscribe every word that Hans said. I consider myself a power user and I'm still getting sucked on this (kid of) basic problems.
Thank you very much.

Danielo Rodríguez

unread,
Dec 13, 2016, 3:25:53 PM12/13/16
to TiddlyWiki

 Hello Jeremy

 
Did the examples on tiddlywiki.com help?

Best wishes

Jeremy

No, they did not. Because there is no example on the reveal widget about how to use text references. I'm used to use text refs within curly braces. You can add this topic to the list of confusing stuff.
Regards 

Jed Carty

unread,
Dec 13, 2016, 4:03:02 PM12/13/16
to TiddlyWiki
What a text reference is isn't really explained anywhere that I have seen. I had to look at the code before I realised what was going on. The only time you see it in most  cases is as a transclusion using {{ and }}. I think this goes along with the differences between {, [ and < inside filters as one of the meaningful but non-obvious nuances in wikitext.

Tobias Beer

unread,
Dec 16, 2016, 6:55:09 AM12/16/16
to tiddl...@googlegroups.com
Hi Danielo / Jed / Hans

In general, I prefer to "reveal" stuff using the list widget, if possible.
Not only will this not create any superfluous html wrapper elements
where you may not need or want them, but it's even shorter...

<$list filter="[bob[eddie]]">
Hi!
</$list>

Instead of:


<$reveal type='match' state='!!bob' text='eddie'>
Hi!
</$reveal>

Best wishes,

Tobias.

Jeremy Ruston

unread,
Dec 16, 2016, 7:32:23 AM12/16/16
to tiddl...@googlegroups.com
This thread is interesting, I’d encourage the participants to try to help fix the documentation.

The TextReference documentation has most of the necessary parts of the explanation; it shows four examples of text references, and then several examples where text references can be used, including showing how a text reference is used with the transclusion syntax. There’s a broken link to IndirectAttributes, but even so, it should be clear on careful reading that {{blah!!field}} is not a text reference, but rather is a text reference used as the argument to a transclusion.

So, how do we make the distinction clearer than the existing text? Is it a matter of more examples? Simpler language? A note to specifically point out the confusion?

Best wishes

Jeremy



On 13 Dec 2016, at 21:03, Jed Carty <inmy...@gmail.com> wrote:

What a text reference is isn't really explained anywhere that I have seen. I had to look at the code before I realised what was going on. The only time you see it in most  cases is as a transclusion using {{ and }}. I think this goes along with the differences between {, [ and < inside filters as one of the meaningful but non-obvious nuances in wikitext.

--
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 tiddlywiki+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.

Mark S.

unread,
Dec 16, 2016, 10:58:59 AM12/16/16
to TiddlyWiki
I was thinking that the first sentence might be replaced by something like:


A TextReference is the ''name'' of a tiddlywiki and optional field whose content contains text to be retrieved or modified by a widget or transclusion. Without the optional field reference, it refers by default to the text field of the named tiddler. Although TextReferences are used //by// transclusions, they are not the same as transclusions.


Mark

Jeremy Ruston

unread,
Dec 16, 2016, 12:37:22 PM12/16/16
to tiddl...@googlegroups.com
Hi Mark

Thanks. I took your text as a starting point and ended up with the following:


Any suggestions for further improvements gratefully received.

Best wishes

Jeremy


Thomas Elmiger

unread,
Dec 16, 2016, 4:25:53 PM12/16/16
to TiddlyWiki
Hi Jeremy

If I get that right, the tip at the end contains a typo (referent => reference) and could possibly be even clearer like:

<$macrocall $name=".tip" _="""Note the difference between a text reference such as `foo!!bar` (the name) and a transclusion of a text reference such as `{{foo!!bar}}` (the value)"""/>

Correct?

All the best!
Thomas (sent from mobile)

Danielo Rodríguez

unread,
Dec 17, 2016, 5:14:06 AM12/17/16
to TiddlyWiki


El viernes, 16 de diciembre de 2016, 18:37:22 (UTC+1), Jeremy Ruston escribió:
Hi Mark

Thanks. I took your text as a starting point and ended up with the following:


Any suggestions for further improvements gratefully received.

Hello, for mi this fragment may be misleading 

+A TextReference is a general purpose way to identify a fragment of text from a tiddler.

 Looks like you could identify a subsection of the text or something like that.
Apart from that, the rest is a great improvement.
In my opinion it is just a matter of including more examples using text references on the widgets that accepts them. When I see a widget that accepts a text reference I'm always unsure about how use it, and  also it's usually the only part that is not included as an example

Jeremy Ruston

unread,
Dec 17, 2016, 7:26:23 AM12/17/16
to tiddl...@googlegroups.com
Thanks Thomas, Danielo,

I’ve made some further tweaks here:


Best wishes

Jeremy

--
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 tiddlywiki+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.

Danielo Rodríguez

unread,
Dec 18, 2016, 11:10:29 AM12/18/16
to TiddlyWiki
Much clearer now
Reply all
Reply to author
Forward
0 new messages