Thanks Andreas,
Captured for future publishing, and possible reference.
I would love to make my own widgets, one day.
I have started working on the use of macros which return a true or false
value then have a simple to read filter that interrogates this status. I
have not yet posted about it, because there is some strange intermittent
behaviour I have not identified.
The Test will look something like this
<$list filter="[enlist<hascaption>prefix[true]]" variable="null">
Has caption
</$list>
So in this case we use a "textual" description of the condition we are testing
eg; hascaption
Regards
Tony
On Tuesday, July 3, 2018 at 9:35:23 AM UTC+10, Andreas Hahn wrote:
>
> Hi Tony,
>
> I figured this might be of interest for your collection, there is another
> way to do conditionals within certain limits if one has the "Tinka" plugin
> installed. Specifically, it includes a plugin similiar to the reveal widget
> in its function but also allows you to check for regex expressions. An
> example use (taken straight from the error-checking section of Tinka):
>
> <!-- Check whether a plugin title was given -->
> <$tinka-check text={{!!create-title-org}} pattern="^[^\s]+$">
> <$tinka-filter verb="fail">
> <$action-setfield $tiddler=<<TinkaVars>> result="true"/>
> <$action-setfield $tiddler=<<TinkaVars>>
> errorTitle="The plugin title is not allowed to be empty or contain
> whitespaces."/>
> </$tinka-filter>
> <$tinka-filter verb="pass">
> <!-- Do something else, plugin title is valid. -->
> </$tinka-filter>
> </$tinka-check>
>
> This is entirely undocumented, but I think its a neat way to do a
> conditional entirely with action widgets (all of those are). Note that
> "pattern" could also just be a value of another tiddler field, in which
> case the verbs "pass" and "fail" would correspond to "match" and "nomatch"
> for the reveal widget. It does only work for action widgets though, since
> nothing is rendered.
>
>
> /Andreas
>
>
--
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 [email protected].
To post to this group, send email to [email protected].
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/d80d1508-ff95-4a7a-b1e7-00de5dfe5f76%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.