Discussion:
[tw5] uniquified slider (reveal) macro not working
(too old to reply)
Dave
2018-12-04 05:29:46 UTC
Permalink
I thought that I was clever to make a slider macro/reveal widget that
stored its state in just the tiddler it was in:

\define slider(label,text)
<$set name=this value=$(currentTiddler)$ >
<$button popup="$:/state/<<this>>$label$" class="btn-invisible
tw-slider">$label$</$button>
<$reveal type="nomatch" text="" default="" state="$:/state/<<this>>$label$"
animate="yes">

$text$

</$reveal></$set>
\end

<<slider "*" "hello there">>


but when I put "<<slider "*" "hello there">>" in two separate tiddlers,
they both open when I click on either of them. If I change the "*" to
something different in the second one, like "**" they stay separate, but I
thought the use of <<this>> (whose value=$(currentTiddler)$) would put the
state in different places because the tiddlers are named differently.

What am I doing wrong here?


thanks,
- Dave
--
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 ***@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/0862d573-2b3f-4e66-ac9f-01e06b4b3465%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Mohammad
2018-12-04 05:42:03 UTC
Permalink
Hi Dave
Check this
http://tw5custom.tiddlyspot.com/#Add%20a%20slider%20macro

/Mohammad
--
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 ***@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/8b2107d7-9789-41cc-8b9b-160bc6746b0c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Jed Carty
2018-12-04 07:05:33 UTC
Permalink
For reasons that have to do with how the macro parser works that I don't
think I can explain in an understandable way right now your set widget is
the problem.

try using this macro instead:

\define slider(label,text)
<$button popup="$:/state/$(currentTiddler)$$label$" class="btn-invisible
tw-slider">$label$</$button>
<$reveal type="nomatch" text="" default="" state="$:/state/$(currentTiddler)
$$label$" animate="yes">


$text$


</$reveal>
\end


<<slider "*" "hello there">>

the quick thing is that $(variable)$ is a direct text substitution and
<<variable>> doesn't work the same way. if you look at the state tiddler
created using yours it is literally called $:/state/<<this>>* without the
<<this>> part being substituted.
--
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 ***@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/d39249d6-7b8d-43ed-ac2e-3b5aec124dd2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Dave
2018-12-04 15:29:39 UTC
Permalink
Thank you Jed (and Mohammed)

I'm glad the reason mine didn't work was convoluted... That way I don't feel so bad for getting it wrong, ha ha
--
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 ***@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/60a0be0c-5a2a-444a-9410-1f466083f839%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Continue reading on narkive:
Loading...