Concatenating Data Tiddler Values

66 views
Skip to first unread message

Mohammad

unread,
May 25, 2018, 1:41:23 PM5/25/18
to tiddl...@googlegroups.com
Is it possible to retrieve and concatenate values from a Data Tiddler (Dictionary)?

To explain in a bit more details consider the following code:


  • Data Tiddler (myConfig) contains
Name: Lecture01
Tag: Lec01
Page: 001
Group: Course 348



  • A button to create a new tiddler using data from the above data tiddler

<$button>
<$action-sendmessage $message="tm-new-tiddler" 
 title={{myConfig##Title}}  tags={{myConfig##Tag}} caption="{{myConfig##Tag}}-Course348"
 page={{myConfig##Page}} text=<<content "SlideContents">>/>
New Slide
</$button>

Note: content is a macro creates some texts to be inserted as a new tiddler text.

This code creates a caption filed for the new tiddler, its value is

caption="{{myConfig##Tag}}-Course348"


It may be the result of concatenation of other values like

caption="{{myConfig##Tag}}-{{myConfig##Group}}"


Is there any short solution to this?


Cheers
Mohammad

Matthew Lauber

unread,
May 25, 2018, 1:59:11 PM5/25/18
to TiddlyWiki
You need the wikify widget.  It's express purpose is to parse wiki text and store it's output for use elsewhere inside it.  So in this example, you would want the following

<$wikify name="caption" text="{{myConfig##Tag}}-Course348">
<$button>
<$action-sendmessage $message="tm-new-tiddler" 
 title={{myConfig##Name}}  tags={{myConfig##Tag}} caption=<<caption>>
 page={{myConfig##Page}} text=<<content "SlideContents">>/>
New Slide
</$button>
</$wikify>


Mohammad

unread,
May 25, 2018, 3:14:21 PM5/25/18
to TiddlyWiki
Many thanks Matthew!
It works now

Cheers
Mohammad


Reply all
Reply to author
Forward
0 new messages