Discussion:
[tw] Issue: Enable numbering on tiddlers created via a Custom Button?
Add Reply
@TiddlyTweeter
2017-08-11 11:43:58 UTC
Reply
Permalink
Raw Message
Ciao all

*Use Case:* A button set-up for writing plain text Tweets (tweetButton).
Should be auto-enumerating.The button below works. I based it on The
Journal Button. There is ONE issue. Though it produces on-click a new
Tiddler titled "Tweet", with the tag "tweet", and the content type
"text/plain", it does *not *auto-add numbers.

What I really want is this ...

- A number that auto-INCREMENTS by one every time a new "Tweet" Tiddler
is created.
- Ideally I'd like that all new tiddlers titles created by it look like
this: "Tweet", "Tweet #0001", Tweet #0002 etc.
- The leading hashtag and the leading zeros are not essential.

I notice that if I remove title="$(tweetTitleTemplate)$" from my current
"tweetButton", below, then it reverts to creating the Title in the standard
way, as "New Tiddler", "New Tiddler 1", "New Tiddler 2". etc. = Numbering
okay. Wrong Title.


I am unclear IF I can get the behaviour I want for my use case or how to
achieve it.


Any help or pointers much appreciated

Best wishes

Josiah


\define tweetButton()
<$button tooltip={{$:/language/Buttons/NewTweet/Hint}} aria-label={{$:
/language/Buttons/NewTweet/Caption}} class=<<tv-config-toolbar-class>>>
<$action-sendmessage $message="tm-new-tiddler" type="text/plain" tags=
"$(tweetTags)$" title="$(tweetTitleTemplate)$" text="$(tweetText)$"/>
<$list filter="[<tv-config-toolbar-icons>prefix[yes]]">
{{$:/core/images/twitter}}
</$list>
<$list filter="[<tv-config-toolbar-text>prefix[yes]]">
<span class="tc-btn-text"><$text text={{$:/language/Buttons/NewTweet/Caption
}}/></span>
</$list>
</$button>
\end
<$set name="tweetTitleTemplate" value={{$:/config/NewTweet/Title}}>
<$set name="tweetTags" value={{$:/config/NewTweet/Tags}}>
<$set name="tweetText" value={{$:/config/NewTweet/Text}}>
<<tweetButton>>
</$set>
</$set>
</$set>
--
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 ***@googlegroups.com.
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/b0e25310-d234-44fd-8218-c5371706b18d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
s***@gmail.com
2017-08-11 11:58:40 UTC
Reply
Permalink
Raw Message
Hi Josiah,

Did you try "action-createtiddler" with the $basetitle attribute, rather
than "tm-new-tiddler"? http://tiddlywiki.com/#ActionCreateTiddlerWidget

Cheers,

Stef
--
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 ***@googlegroups.com.
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/835d85ba-db53-4337-8bc4-fbf5a204a455%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
@TiddlyTweeter
2017-08-11 12:50:13 UTC
Reply
Permalink
Raw Message
Ciao Stef & all

***@gmail.com wrote:Did you try "action-createtiddler" with the
$basetitle attribute, rather than "tm-new-tiddler"?
http://tiddlywiki.com/#ActionCreateTiddlerWidget
<http://www.google.com/url?q=http%3A%2F%2Ftiddlywiki.com%2F%23ActionCreateTiddlerWidget&sa=D&sntz=1&usg=AFQjCNFtwA1qnh7mhzDu7ghDQ7FjQrBB7w>

Thanks. Its getting a bit clearer, but I'm not quite there yet.

That worked to complete the titles with correct numbers: "Tweet, Tweet 1,
Tweet 2" etc. Unfortunately it doesn't seem open the new "Tweet" tiddler in
the editor. Here is the revised code ...

\define tweetButton()
<$button tooltip={{$:/language/Buttons/NewTweet/Hint}} aria-label={{$:
/language/Buttons/NewTweet/Caption}} class=<<tv-config-toolbar-class>>>
<$action-createtiddler $basetitle="$(tweetTitleTemplate)$" type="text/plain"
tags="$(tweetTags)$" text="$(tweetText)$"/>

<$list filter="[<tv-config-toolbar-icons>prefix[yes]]">
{{$:/core/images/twitter}}
</$list>
<$list filter="[<tv-config-toolbar-text>prefix[yes]]">
<span class="tc-btn-text"><$text text={{$:/language/Buttons/NewTweet/Caption
}}/></span>
</$list>
</$button>
\end
<$set name="tweetTitleTemplate" value={{$:/config/NewTweet/Title}}>
<$set name="tweetTags" value={{$:/config/NewTweet/Tags}}>
<$set name="tweetText" value={{$:/config/NewTweet/Text}}>
<<tweetButton>>
</$set>
</$set>
</$set>
--
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 ***@googlegroups.com.
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/45fe7abb-af01-46aa-910f-89907bb3c891%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
s***@gmail.com
2017-08-11 14:57:00 UTC
Reply
Permalink
Raw Message
Hi Josiah,

You could try something like this:

\define tweetButton()
<$button tooltip={{$:/language/Buttons/NewTweet/Hint}} aria-label={{$:
/language/Buttons/NewTweet/Caption}} class=<<tv-config-toolbar-class>>>
<$action-createtiddler $basetitle="$(tweetTitleTemplate)$" type="text/plain"
tags="$(tweetTags)$" text="$(tweetText)$" $savetitle="!!tiddlertitle"/>


<$list filter="[<tv-config-toolbar-icons>prefix[yes]]">
{{$:/core/images/twitter}}
</$list>
<$list filter="[<tv-config-toolbar-text>prefix[yes]]">
<span class="tc-btn-text"><$text text={{$:/language/Buttons/NewTweet/Caption
}}/></span>
</$list>
<$action-sendmessage $message="tm-edit-tiddler" $param={{!!tiddlertitle}}/>
</$button>
\end
<$set name="tweetTitleTemplate" value="Tweet">
<$set name="tweetTags" value={{$:/config/NewTweet/Tags}}>
<$set name="tweetText" value={{$:/config/NewTweet/Text}}>
<<tweetButton>>
</$set>
</$set>
</$set>

Cheers,

Stef
--
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 ***@googlegroups.com.
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/cfd9d8eb-beb6-449a-bc68-125c792479a1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
s***@gmail.com
2017-08-11 15:17:25 UTC
Reply
Permalink
Raw Message
Here is my code again, with a small correction:


\define tweetButton()
<$button tooltip={{$:/language/Buttons/NewTweet/Hint}} aria-label={{$:
/language/Buttons/NewTweet/Caption}} class=<<tv-config-toolbar-class>>>
<$action-createtiddler $basetitle="$(tweetTitleTemplate)$" type="text/plain"
tags="$(tweetTags)$" text="$(tweetText)$" $savetitle="!!tiddlertitle"/>



<$list filter="[<tv-config-toolbar-icons>prefix[yes]]">
{{$:/core/images/twitter}}
</$list>
<$list filter="[<tv-config-toolbar-text>prefix[yes]]">
<span class="tc-btn-text"><$text text={{$:/language/Buttons/NewTweet/Caption
}}/></span>
</$list>
<$action-sendmessage $message="tm-edit-tiddler" $param={{!!tiddlertitle}}/>
</$button>
\end

<$set name="tweetTitleTemplate" value={{$:/config/NewTweet/Title}}>
<$set name="tweetTags" value={{$:/config/NewTweet/Tags}}>
<$set name="tweetText" value={{$:/config/NewTweet/Text}}>

<<tweetButton>>
</$set>
</$set>
</$set>

Cheers,

Stef
Post by s***@gmail.com
Hi Josiah,
--
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 ***@googlegroups.com.
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/fe5944d3-fa12-452f-bff0-54149e782063%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
@TiddlyTweeter
2017-08-11 20:59:18 UTC
Reply
Permalink
Raw Message
Ciao Stef

Unfortunately neither version works for me. They open a new tiddler for
editing but the Title is blank :-(

Josiah
Post by @TiddlyTweeter
\define tweetButton()
/language/Buttons/NewTweet/Caption}} class=<<tv-config-toolbar-class>>>
<$action-createtiddler $basetitle="$(tweetTitleTemplate)$" type=
"text/plain" tags="$(tweetTags)$" text="$(tweetText)$" $savetitle=
"!!tiddlertitle"/>
<$list filter="[<tv-config-toolbar-icons>prefix[yes]]">
{{$:/core/images/twitter}}
</$list>
<$list filter="[<tv-config-toolbar-text>prefix[yes]]">
<span class="tc-btn-text"><$text text={{$:/language/Buttons/NewTweet/
Caption}}/></span>
</$list>
<$action-sendmessage $message="tm-edit-tiddler" $param={{!!tiddlertitle}}/
</$button>
\end
<$set name="tweetTitleTemplate" value={{$:/config/NewTweet/Title}}>
<$set name="tweetTags" value={{$:/config/NewTweet/Tags}}>
<$set name="tweetText" value={{$:/config/NewTweet/Text}}>
<<tweetButton>>
</$set>
</$set>
</$set>
Cheers,
Stef
Post by s***@gmail.com
Hi Josiah,
--
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 ***@googlegroups.com.
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/73e93bb5-b085-4fab-96e0-23ca118bc798%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
s***@gmail.com
2017-08-11 21:42:35 UTC
Reply
Permalink
Raw Message
Post by @TiddlyTweeter
Unfortunately neither version works for me. They open a new tiddler for
editing but the Title is blank :-(
This is odd... when I copy the first version of my code (in which the value
of $basetitle is hard-coded as "Tweet") into tiddlywiki.com, it works out
of the box!

Stef
--
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 ***@googlegroups.com.
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/cfe47080-5668-42b8-be5c-abd9f664ed31%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
s***@gmail.com
2017-08-11 21:51:54 UTC
Reply
Permalink
Raw Message
Post by @TiddlyTweeter
Unfortunately neither version works for me. They open a new tiddler for
editing but the Title is blank :-(
Well, must admit that I didn't try using this as a sidebar button. Try
replacing both occurrences of "!!tiddlertitle" with
"tweetButton!!tiddlertitle". Does this work?

Stef
--
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 ***@googlegroups.com.
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/71bf6287-af7e-4dce-ae2f-589422c466c0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
s***@gmail.com
2017-08-11 22:13:26 UTC
Reply
Permalink
Raw Message
Post by @TiddlyTweeter
Unfortunately neither version works for me. They open a new tiddler for
editing but the Title is blank :-(
Try replacing both occurrences of "!!tiddlertitle" with
"tweetButton!!tiddlertitle". Does this work?
Or whatever the title of the tiddler containing the Tweet Button is, of
course.
--
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 ***@googlegroups.com.
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/152a131e-896e-4d77-a5f3-b9a0dde04e4c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
@TiddlyTweeter
2017-08-12 09:14:43 UTC
Reply
Permalink
Raw Message
Ciao Stef
Try replacing both occurrences of "!!tiddlertitle" with
"tweetButton!!tiddlertitle". Does this work?
Many thanks! Its working. Much appreciated.

Best wishes
Josiah
--
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 ***@googlegroups.com.
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/9873246b-f48b-41be-b276-e8915213ab44%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...