TW5: Concatenated TextReferences

68 views
Skip to first unread message

Tobias Beer

unread,
Sep 18, 2015, 4:07:07 PM9/18/15
to tiddl...@googlegroups.com
Mhhh, I'll attribute it to having been away for a while
or maybe it's one of those things that just won't work.

Here's the situation and I can't wrap my head around solving it...

Assume...
  • there's a variable state used to trigger visibility
  • this tiddler has an additional field called new-title
  • and I'm in the context of a macro that knows of a parameter old-title
Now, here's the issue...

I want to read the field new-title from tiddler state and assign it as the title to tiddler old-title.

<$button>
<$action-setfield $tiddler="$old-title$" title={{
??WHAT-TO-DO??}}/>
rename
</$button>

What to do (again)?

Note: new-title got changed since the time the widget-tree was rendered.

Best wishes,

— tb

Andreas Hahn

unread,
Sep 18, 2015, 4:45:08 PM9/18/15
to tiddl...@googlegroups.com
Hi Tobias,

you could define it like this:

\define changer(old-title)
<$set name="currentTiddler" value="$(state)$">
    <$button>
        <$action-setfield $tiddler="$old-title$" title={{!!new-title}}/>
        copy
    </$button>
</$set>
\end
Please note that it only archieves a copy functionality rather than a rename (i.e. the original tiddler will still exist)

/Andreas




Am 18.09.2015 um 22:07 schrieb Tobias Beer:
Mhhh, I'll attribute it to having been away for a while
or maybe it's one of those things that just won't work.

Here's the situation and I can't wrap my head around solving it...

Assume...
  • there's a variable state holding the title of a state tiddler
  • this tiddler has field called new-title
  • and I'm in the context of a macro that knows of a parameter old-title
Now, here's the issue...

I want to read the field new-title from tiddler state and assign it as the title to tiddler old-title.

<$button>
<$action-setfield $tiddler="$old-title$" title={{
??WHAT-TO-DO??}}/>
rename
</$button>

What to do (again)?

Best wishes,

— tb
--
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 tiddl...@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/a8cd3caa-d8e7-4616-9630-bf5a6c9892c1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Tobias Beer

unread,
Sep 18, 2015, 7:14:41 PM9/18/15
to TiddlyWiki
Hi Andreas,
 
you could define it like this:

Muchas gracias.
Of course, the button goes into its own macro. ^_^

The following is probably around somewhere already...
If not, I've used the method to play with a litte macro
that allows to inline-edit tiddler titles or other fields of tiddlers:


Best wishes,

— tb
Reply all
Reply to author
Forward
0 new messages