TW5 Newhere button process and example

434 views
Skip to first unread message

David Gifford

unread,
Apr 29, 2014, 5:58:27 PM4/29/14
to tiddl...@googlegroups.com
Hello everyone,

One outstanding ticket for TW5 was the creation of something that fulfills the function of the NewHerePlugin for TW classic (http://mptw.tiddlyspot.com/#NewHerePlugin). That plugin allows the user to click a button in one tiddler, a parent tiddler, and create a new tiddler, the child tiddler, tagged with the title of the parent tiddler.

A while back Stephan Hradek created a new tiddler plugin for TW5. Last week I finally sat down and figured out how to use his plugin to create a new here button. You can see it in action, and see a number of tweaks I have made to TW5, at http://giffmex.org/experiments/braintags.html. In the toolbar at the top of each tiddler there you will see five extra icons. These are new here buttons based on different templates. (Please note that this file is a personal experimental sandbox. It is not meant for general distribution. Should you download it and use it for your own note-taking, I don't mind, but use only with extreme caution. I will not be responsible for anything that happens to your data if you run into problems.)

In order to close the outstanding ticket for TW5, I wanted to write up, here, the process, so you can create your own new here buttons.

1. GET THE PLUGIN: Go to Stephan's site http://tiddlystuff.tiddlyspot.com/ and open the More tab, then open the System tab. Drag the following tiddler to your TW5: $:/plugins/skeeve/newtiddler.

2. SET UP THE BUTTON SCRIPT:

Create a tiddler ($:/_viewtoolbar/newherebutton or a name of your choosing) and tag it $:/tags/ViewToolbar. Paste the following in the tiddler, then close and save.

\define get_title(l)
$l$$(title)$]]
\end

<$set name="title" value={{!!title}}>
<$set name="tags" value=<<get_title "[[">>>
<$newtiddler class="btn-invisible" title="your title here" skeleton="$:/_template/newhere">{{ $:/core/images/new-button  }}</$newtiddler>
</$set>
</$set>

(Note that this should be placed at the VERY TOP of the tiddler body.)

3. POSITION THE NEW BUTTON CORRECTLY IN THE VIEWTEMPLATE

In your TW's More tab, in the Shadows tab, open the tiddler $:/tags/ViewToolbar. Click to edit, and in the list field, add $:/_viewtoolbar/newherebutton TO THE LEFT of the other tiddler names listed. Close and save.

4. CREATE THE TEMPLATE OR SKELETON TIDDLER

Create a new tiddler
entitled $:/_template/newhere. Tag the tiddler $(tags)$. Upon adding this tag, it will turn into a dot or an invisible tag. Not to worry. If you wish to add any content or other tags you wish to appear on every single new tiddler you make with the newhere button, feel free to add that, too. Close and save.

Now you should have a new tiddler button to the left of the other icons at the top of all tiddlers, that when clicked, creates a new tiddler based on the template or skeleton tiddler, whose tag is the title of the tiddler from which you clicked the newhere button.

For a little more documentation, see the tiddler Newtiddler Widget at Stephan's site http://tiddlystuff.tiddlyspot.com/.

Enjoy your new here buttons, everyone! And don't forget to bookmark this thread so you don't lose these instructions.

Xavier Cazin

unread,
Apr 30, 2014, 4:53:37 AM4/30/14
to tiddl...@googlegroups.com
Hi David,

Thank you for sharing! Just wanted to add, for your step 3, that instead of editing the list field of $:/tags/ViewToolbar, it's easier to set an empty list-before field in $:/_viewtoolbar/newherebutton (see http://tiddlywiki.com/static/TiddlerTags.html).

Best,
Xavier Cazin.

-- Xavier Cazin


--
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.
For more options, visit https://groups.google.com/d/optout.

Alberto Molina

unread,
Apr 30, 2014, 5:38:26 AM4/30/14
to tiddl...@googlegroups.com
Thank you very much for sharing!

Alberto
Message has been deleted

Matabele

unread,
Apr 30, 2014, 2:17:07 PM4/30/14
to tiddl...@googlegroups.com
Hi

Many thanks - I have incorporated this feature into a quick and dirty (but functional) gTD -- take a look here.

I have included a tabbed left slider menu for gTD and have fixed the slider mechanism for v_5.0.10 (also fixed the reliance on fontawesome.)

regards

Ton Gerner

unread,
Apr 30, 2014, 2:36:07 PM4/30/14
to tiddl...@googlegroups.com
Hi Dave,

Jeremy showed a little bit of it during the last Hangout.
Nice clean interface.
Interesting flexible search.
Thanks for sharing.

Cheers,

Ton


On Tuesday, April 29, 2014 11:58:27 PM UTC+2, David Gifford wrote:

Danielo Rodríguez

unread,
May 2, 2014, 9:48:38 AM5/2/14
to tiddl...@googlegroups.com

Hello everyone

I see that you are taking advantage of Stephan's widget.
I just want to let you know (for those who doesn't know) that I modified Stephan's widget to accept a tag parameter and a clear parameter. 

This way you can clear fields when adding a new todo (for example) and avoid ugly empty tags at your tag's list. 

You can see an example at braintest.tiddlyspot.com editable table.

Regards.

David Gifford

unread,
May 2, 2014, 3:48:05 PM5/2/14
to tiddl...@googlegroups.com
Cool Danielo! Great addition.


--
You received this message because you are subscribed to a topic in the Google Groups "TiddlyWiki" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tiddlywiki/Yz2C7lPnM4E/unsubscribe.
To unsubscribe from this group and all its topics, 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.
For more options, visit https://groups.google.com/d/optout.



--
David Gifford
Christian Reformed World Missions, Mexico City

Matabele

unread,
May 3, 2014, 2:15:03 AM5/3/14
to tiddl...@googlegroups.com
Hi Danielo

When I tried the editable table from your site, although the edit button and other functionality worked fine, the '+' add row button did not appear to function -- this still appears to be the case for me now.

I am interested in making use of your version of <$newtiddler> -- could you please write some notes for your modifications in a separate tiddler as I am having problems getting it to work. I don't know if this is a browser or browser plugin problem, or if I am being thick.

I suggest, perhaps, that you name your version '$:/plugins/danielo/newtiddler' to avoid confusion for users.

regards

Stephan Hradek

unread,
May 3, 2014, 2:28:44 AM5/3/14
to tiddl...@googlegroups.com


Am Freitag, 2. Mai 2014 15:48:38 UTC+2 schrieb Danielo Rodríguez:

editable table.
Small proposal:
1. Remove the word "Edit" from the headerline and replace it with the "+"
2. Remove the editable line below the heade

At the moment you first enter data and then press "+" to append the editable line.

Why not first press "+" to make a new line appear in edit mode?

You save some space on screen by getting rid of an otherwise unrequired line.

Matabele

unread,
May 3, 2014, 6:11:35 AM5/3/14
to tiddl...@googlegroups.com
Hi Danielo

OK, I was being dumb - I had existing tags in my skeleton - this prevented new tags from being added.

regards

On Friday, May 2, 2014 3:48:38 PM UTC+2, Danielo Rodríguez wrote:

Danielo Rodríguez

unread,
May 4, 2014, 6:09:42 AM5/4/14
to tiddl...@googlegroups.com
Hello Matabelle. So it's all working for you?

The extra pparameters are :
Tag:a Tag to be added. I don't know if just one or a list. I have to check it out. I think the good thing is to accept a comma separated list.

Clear: a temporary tiddler to be cleared after new tiddler creation. I suggest to use a single tiddler for all the temp data. I used to use the tiddler text as title of the new widget and other fields as extra information.

Regards.

Danielo Rodríguez

unread,
May 4, 2014, 6:12:35 AM5/4/14
to tiddl...@googlegroups.com
Hello Stephan

As usual thank you for your suggestion. The problem is that the title of the new tiddler as to be set. If I create a new line in edit mode tipping the title of the tiddler will result in a new tiddler for each keystroke.

Maybe we can find a workaround together :)

Matabele

unread,
May 4, 2014, 10:20:57 AM5/4/14
to tiddl...@googlegroups.com
Hi Danielo

Yes thanks -- now have it working for my purpose. The 'tags' parameter accepts a list of tag names -- I use a list of names separated with a space (I tried something else that didn't work, I think a comma.) The tags parameter only appears to work if the tags field of the skeleton is empty -- this held me up for some time. All tags required in the newtiddler must, therefore, be listed in the tags parameter, and the skeleton must have no tags.

I have done a minor cosmetic edit of your plugin which can be seen in action here: http://wills.tiddlyspot.com/ 

I suppose it would be better to rename the widget call as well, as conflicts would arise if both plugins are installed.

regards

Matabele

unread,
May 4, 2014, 10:34:15 AM5/4/14
to tiddl...@googlegroups.com
Hi

A suggestion to solve the problem with the add row function of your editable table. As suggested, put the '+' button in the header -- when clicked, a row is inserted which can be edited, but this row is not live, but a copy in a temporary template. On the RHS of this row is now a '+' - when clicked this inserts the contents of the template, transforming the row into a normal row (with an edit button on the RHS.)

This does not differ much from your existing version -- only that the top row is hidden and drops down only when the '+' in the header is selected.

regards 

Danielo Rodríguez

unread,
May 4, 2014, 1:40:16 PM5/4/14
to tiddl...@googlegroups.com
Hi matabelle.

I didn't though about the issue with the tags. I think I can easily fix it.

Anyway I will check your edit.

About the naming.... As you said I didn't change the name to avoid the possibility of having several "instances" of the same plugin.

Reply all
Reply to author
Forward
0 new messages