Oh,
One big leap in my understanding occurred when I learned this
*However, within TiddlyWiki *filters*, there is no need doubling the brackets*,
as HTML is not allowed *within* the filter, so only single <variableName> is
used.
...and why I don't have to wrap <fieldname> with [<fieldname>] before giving it
to split?
Think of the brackets in filters as part of the operand itself rather than a
"container" for the operand. The type of bracket indicates the type of operand
being used:
use [...] for literal values, e.g., [texthere]
use {...} for field references, e.g., {!!fieldname}
use <...> for variables e.g. <currentTiddler>
Thus, to split the literal text, "sometext", you could write:
[title[sometext]splitbefore[t]removesuffix[t]]
you would get "some" as a result.
If the value "sometext" is stored in a field named "somefield" in the current
tiddler, you could write:
[{!!somefield}splitbefore[t]removesuffix[t]]
and, if the value "sometext" is stored in a variable named "somevariable", you
could write:
[<somevariable>splitbefore[t]removesuffix[t]]
As a slightly more complex example, suppose the value to split on was also
stored in a variable. Then you could write:
[<somevariable>splitbefore<othervariable>removesuffix<othervariable>]
Regards
Tony
On Monday, 28 September 2020 08:49:11 UTC+10, TW Tones wrote:
>
> Bob,
>
> There is an older resource on this here http://pv5.tiddlyspot.com however
> I will update my own abridged version and share a cheat sheet today.
>
> Regards
> Tony
>
> On Sunday, 27 September 2020 16:52:29 UTC+10, Bob Jansen wrote:
>>
>> I know and am very thankful of the many items of advice I have received
>> in the past. But I am still frustrated - there must be some core element I
>> am not understanding.
>>
>> The main issue is how to address items in wikitext, {{ [[ {{{ << < etc.
>> I know this all depends on how the item is being used but a simple cheat
>> sheet with many examples would be really useful. I don't find the
>> Tiddlywiki documentation easy to follow, bits are all over the place and
>> none of the examples address my problems I find.
>>
>> For example, why does this not work?
>>
>> <$button>
>> <$action-setfield
>> $tiddler="$:/TLS/exhibition_id"
>> $value={{!!exhibition_id}}
>> />
>> <!--append the exhibition_id to the exhibition id field in each artwork-->
>> <$list filter="[tag[Mark]]">
>> <$action-setfield
>> $field="exhibition_id"
>> $value=<<TLSconcatenate {{!!exhibition_id}}
>> {{$:/TLS/exhibition_id}}>>
>> />
>> </$list>
>>
>> Link Artworks to Exhibition
>> </$button>
>>
>>
>> The result is the string {{!!exhibition_id}} {{$:/TLS/exhibition_id}}
>> stored in the exhibition_id field of each artwork selected and not the
>> transcluded values.
>>
>> TLSconcatenate is a simple macro to concatenate two strings
>>
>> \define TLSconcatenate(head tail) $head$$tail$
>>
>> bobj
>>
>>
--
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 view this discussion on the web visit
https://groups.google.com/d/msgid/tiddlywiki/68868f04-4b32-4f1f-902c-ccd48fd3e582o%40googlegroups.com.