Variable as $review state?

139 views
Skip to first unread message

GBNeil

unread,
Aug 6, 2015, 3:30:07 PM8/6/15
to TiddlyWiki
Hi folks,

could someone put me out if my misery pls!?!


<$set name=var filter="[tag[urgent]]" value="show" emptyValue="hide">

<$reveal type="match" state=<
<var>> text="show">

`
state=<<var>> not recognised despite var being set to "show" `

<<var>>

</$reveal>

</$set>


Thanks in advance :)

Felix Küppers

unread,
Aug 6, 2015, 3:48:17 PM8/6/15
to tiddl...@googlegroups.com
Hi GBNeil,

state doesn't make sense here since you are working with variables.
<<var>> should go to the default attribute in the reveal, if you use "state" it will look for a tiddler named "show" or "hide".

then you need to at a "text" attribute for reveal e.g. text="show"

e.g. <$reveal type="match" text="show" default=<<var>>>

-Felix
--
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 http://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/b28bb06a-09dd-48a4-abec-e17e00558a51%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Eric Shulman

unread,
Aug 6, 2015, 3:55:18 PM8/6/15
to TiddlyWiki
1) $set widget can use value="..." or filter="...", but **not both**
2) The state="..." param is supposed to be a TiddlerTitle, not an actual state value

It's not 100% clear to me what you are trying to accomplish, but... it seems like perhaps you are trying to conditionally display some content if the current tiddler is tagged with "urgent".  If this is the case, then use the <$list> widget, like this:

<$list filter="[all[current]tag[urgent]">
   this content appears only when current tiddler is tagged with "urgent"
<$list>


enjoy,
-e
Eric Shulman
ELS Design Studios
TiddlyTools - "Small Tools for Big Ideas!"
InsideTiddlyWiki: The Missing Manuals

YOUR DONATIONS ARE VERY IMPORTANT!
HELP ME TO HELP YOU - MAKE A CONTRIBUTION TO MY "TIP JAR"...

Professional TiddlyWiki Consulting Services...
Analysis, Design, and Custom Solutions:

GBNeil

unread,
Aug 6, 2015, 4:22:01 PM8/6/15
to TiddlyWiki
@Eric, http://tiddlywiki.com/#RevealWidget - Conditional Variable Assignment: 'This form of the set variable widget chooses one of two specified values according to whether a filter evaluates to an empty list'
It works nicely with default=<<var>> (thanks again Felix)
Cheers

David Someone

unread,
Aug 20, 2016, 3:45:33 PM8/20/16
to TiddlyWiki

On Thursday, 6 August 2015 20:55:18 UTC+1, Eric Shulman wrote:

<$list filter="[all[current]tag[urgent]">
   this content appears only when current tiddler is tagged with "urgent"
<$list>


I just pooped myself.
Reply all
Reply to author
Forward
0 new messages