"tm-fold-tiddler" doesn't seem to work

66 views
Skip to first unread message

ste...@gmail.com

unread,
Aug 5, 2017, 3:07:12 PM8/5/17
to TiddlyWiki
Hi,

I'm trying to generate new tiddlers using the action-createtiddler widget and fold them immediately with "tm-fold-tiddler". However, the folding doesn't seem to work. This is my code, which I want to use to import individual posts ("toots") from the social network Mastodon:

<$edit-text tiddler="$:/temp/mytoot" tag="input" field="titel" default="Toot Title" size=30/>


<br />
<$edit-text tiddler="$:/temp/mytoot" tag="textarea" class="editorArea" default="json toot"/>


<$button>
<$action-createtiddler $basetitle={{$:/temp/mytoot!!titel}} tags="Toots" type="application/json" $savetitle="!!toot-titel" text={{$:/temp/mytoot}}/>
Save json toot
<$action-sendmessage $message="tm-fold-tiddler" $param={{$:/temp/mytoot!!titel}} $foldedStatePrefix="$:/state/folded/">
<$action-deletetiddler $tiddler="$:/temp/mytoot"/>
</$button>

What am I doing wrong?

Many thanks,

Stef

Mark S.

unread,
Aug 5, 2017, 4:21:31 PM8/5/17
to TiddlyWiki
The documentation appears to be wrong. I put together code that seems to work.

\define folded-state2()
$
:/state/folded/$(foldme)$
\end
<$set name="foldme" value={{$:/temp/mytoot!!titel}}>
<$button>Fold the thing

<$action-sendmessage $message="tm-fold-tiddler" $param=<<foldme>> foldedState=<<folded-state2>> />
</
$button>

<<folded-state>>
</$set>



On Saturday, August 5, 2017 at 12:07:12 PM UTC-7, ste...@gmail.com wrote:
Hi,

I'm trying to generate new tiddlers using the action-createtiddler widget and fold them immediately with "tm-fold-tiddler". However, the folding doesn't seem to work. This is my code, which I want to use to import individual posts ("toots") from the social network Mastodon:

\define folded-state2()
$:/state/folded/$(foldme)$
\end


<$edit-text tiddler="$:/temp/mytoot" tag="input" field="titel" default="Toot Title" size=30/>


<br />
<$edit-text tiddler="$:/temp/mytoot" tag="textarea" class="editorArea" default="json toot"/>

<$set name="foldme" value={{$:/temp/mytoot!!titel}}>

<$button>
<$action-createtiddler $basetitle={{$:/temp/mytoot!!titel}} tags="Toots" type="application/json" $savetitle="!!toot-titel" text={{$:/temp/mytoot}}/>
Save json toot
<$action-sendmessage $message="tm-fold-tiddler" $param=<<foldme>> foldedState=<<folded-state2>> />
</$button>
</$set>

ste...@gmail.com

unread,
Aug 6, 2017, 6:18:49 AM8/6/17
to TiddlyWiki
Hi Mark,

On Saturday, August 5, 2017 at 10:21:31 PM UTC+2, Mark S. wrote:
The documentation appears to be wrong. I put together code that seems to work.
 
Thank you very much! Following your suggestion, I modified my code, and it works fine now.

My code looks like this now:

\define folded-state2()
$
:/state/folded/$(foldme)$
\end
<$edit-text tiddler="$:/temp/mytoot" tag="textarea" class="editorArea" default="json toot"/>
<$edit-text tiddler="$:/temp/mytoot" tag="input" field="titel" default="Toot Title" size=40/>

<$set name="foldme" value={{$:/temp/mytoot!!titel}}>
<$button>
<$action-createtiddler $basetitle={{$:/temp/mytoot!!titel}} tags="Toots" type="application/json" $savetitle="!!toot-titel" text={{$:/temp/mytoot}}/>
Save json toot
<$action-sendmessage $message="tm-fold-tiddler" $param=<<foldme>> foldedState=<<folded-state2>>
/>
<$action-deletetiddler $tiddler="$:/
temp/mytoot"/>
</$button>
</$set>

For explanation: I wanted to hide the original JSON content of the tiddlers, because I create formatted output with custom code from another tiddler tagged $:/tags/ViewTemplate. 

Thanks!

Cheers,

Stef
Reply all
Reply to author
Forward
0 new messages