TW5 - Adding "Clone This Tiddler" icon to main tiddler display.

709 views
Skip to first unread message

David Richards

unread,
Jan 1, 2014, 10:06:23 AM1/1/14
to tiddl...@googlegroups.com
I would like these two things:

1. I want a way to clone a tiddler without having to edit it, add this code...

<$button message="tw-new-tiddler" param=<<currentTiddler>>>clone this tiddler</$button>

... then close it, click the button, and delete the code from the new tiddler. What a pain.

How can I hack TW5 so that if I click the 'edit tiddler' button with a modifier key depressed (e.g. 'Option' on a Mac) that it opens a copy of the current tiddler for editing, rather than the current tiddler itself?

2. Also, I want way to delete a field or create a new field in all toddlers having a given tag. There may already be a way to do this but I don't know the code for it.

Thanks.

dr

Ton Gerner

unread,
Jan 1, 2014, 12:26:15 PM1/1/14
to tiddl...@googlegroups.com
Hi David,

For 1) see my guide for (toolbar) buttons [1].

Cheers,

Ton

[1] http://tw5toolbar.tiddlyspot.com/

Jeremy Ruston

unread,
Jan 1, 2014, 3:19:16 PM1/1/14
to TiddlyWiki
Hi David

2. Also, I want way to delete a field or create a new field in all toddlers having a given tag. There may already be a way to do this but I don't know the code for it.

Can you expand on what you're trying to achieve, and how you'd envisage it working?

Best wishes

Jeremy
 

Thanks.

dr

--
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/groups/opt_out.



--
Jeremy Ruston
mailto:jeremy...@gmail.com

David Richards

unread,
Jan 2, 2014, 4:07:03 AM1/2/14
to tiddl...@googlegroups.com
Thanks Ton, your guide looks very helpful and I'll have a close look at it.

- David

David Richards

unread,
Jan 2, 2014, 4:24:32 AM1/2/14
to tiddl...@googlegroups.com, jeremy...@gmail.com
Hi Jeremy,

So, roughly, I'd like to treat tags as 'classes', with tiddlers being 'instances' of those tag-classes. Adding a field to all 'instances' is roughly equivalent to modifying the 'bass class'. I know the analogy breaks down on a number of levels, but it's somewhat descriptive.

If I have a great number of identically tagged tiddler-objects, it would be tedious to have to add a new field to each of those tiddler objects individually.

Another rough analogy: adding a column to a SQL table, which creates a new field in every record.

- David

Jeremy Ruston

unread,
Jan 2, 2014, 5:11:54 AM1/2/14
to David Richards, TiddlyWiki
Hi David

That makes sense. There is no user interface support for bulk operations at the moment. The plan is to be able to see a list of tiddlers for which one can select different filters. Each tiddler would have a checkbox, and there would be an action button to apply an action to the selected tiddlers.

It is possible to write JavaScript to do these bulk operations, and then execute it in your browser developer console. Stephan Hradek has a nice collection of bookmarklets that show off the technique:


Having said that, you are trying to fit an existing, slightly different mental programming model onto TiddlyWiki, which may not be the best way to start. Tags in TiddlyWiki do behave a bit like classes, but they don't have the same semantics, intentionally. TiddlyWiki could have presented a conventional SQL-like view of data, but it's designed for writers and thinkers, and not primarily for programmers - people who want to think like programmers already have a panoply of tools available to help them realise their ideas.

So I guess I'm saying that if it's of primary importance to be able to manipulate your data as though it were a SQL database or strongly typed object instances in a class hierarchy, then you may be better off looking at tools that directly support those paradigms. Kludging TiddlyWiki to work like that is likely to be an uphill struggle.

That all sounds a bit discouraging, I'm really just encouraging you to explore the way that TiddlyWiki works intrinsically; watch which way the river flows and try rowing in the same direction.

A classic example of using TiddlyWiki is as a mini-CRM system. One might have tiddlers that represent people, organisations, meetings, projects and so on, each class being represented by a tag, as you've surmised. People would be tagged with the organisation(s) and projects to which they belong. External companies might be tagged with the name of the internal person who's responsible for the relationship.

Then, one would want an "address" field, say, on tiddlers that represent people and organisations. Rather than modifying the tiddlers with that tag, the trick is to modify the edit template used for tiddlers with that tag to show the apparatus for editing the address, and modify the view template to show the address (perhaps with a link to google maps).

Done like that, if you were to decide to introduce a new field to tiddlers tagged "meeting" you wouldn't go round adding it to each tiddler, instead you'd just modify the template handling to show the additional field.

Best wishes

Jeremy
Reply all
Reply to author
Forward
0 new messages