Need help wiith buttons for adding and removing tags

192 views
Skip to first unread message

David Gifford

unread,
Jun 30, 2016, 8:23:50 AM6/30/16
to TiddlyWiki
Hi guys

I have a really cool idea, but it might be just a bit beyond me. I am going to tinker today, but I figure you guys will have better ideas about how best to do this.

I currently tend to use a tiddler titled $:/.Children, and tagged "$:/tags/ViewTemplate" . This tiddler lists links to the titles of all the tiddlers with backlinks to the current tiddler. The list appears at the bottom of the tiddler, below the text.

I would like to be able to toggle between viewing four such "children" in the open tiddlers:

1) $:/.Linksviewer: Lists only the title links for all backlinks.
2) $:/.Printviewer: Shows the text field for all backlinks, separated by a <hr>,
3) $:/FullViewer: Same as #2 but also including a link to each of those tiddlers [[(open)|title]], and
4) Blank: none of the three previous are tagged "$:/tags/ViewTemplate", and nothing shows below the text field. This would be default.

Rationale:

a) My notetaking for this TW would be adding individual observations, quotes, etc and adding links (rather than tags) to related topics and sources. The tiddlers would have datetimestamps to save me from naming the tiddlers. Then I create topic tiddlers from the empty links in the note tiddlers (and from the "Missing" tab).  I have found this to be the fastest way to add notes and connect them. I also tend to move from the top down by creating table of contents tiddlers for broader subjects.
b) Different types of tiddlers need different types of displays of related tiddlers. But viewers 2 and 3 would slow down TiddlyWiki if they were default. At least, that has been my experience. Jeremy once told me it is because it is a complex list filter being applied to the tiddlers. So I am thinking that 1, 2, and 3 can be viewers that let you see this content when needed, and turned off most of the time when speed is of the essence. Maybe my reasoning is wrong, I don't know.

I know how to create the 3 list filters.

What I don't know how to do is create buttons to put in the sidemenu that add the "$:/tags/ViewTemplate" tag to one viewer and remove that tag from the other two. I was originally thinking of 4 buttons, but maybe a dropdown list would be better? Also I don't know how to make #4 the default when opening the TW.

Anyway, this is a little beyond my ability and I was wondering if a few of you might lend me a hand / suggestions. I will share the results freely with everyone when I am done with it.

Dave

Mark S.

unread,
Jun 30, 2016, 9:20:10 AM6/30/16
to TiddlyWiki
I'm sure someone will have a great solution for you. Off hand, I'm thinking that a radio button would give you your 4 conditions. Your viewer could then have 4 reveal widgets depending on the status of the radio button. Not sure if the radio button widget has a default (it's not in the docs -- the HTML radio button does). But would a default matter after the first use anyways? Or did you want a different setting for each tiddler you are viewing (unlike the "preview" mode which changes every tiddler's view mode).

Mark

David Gifford

unread,
Jun 30, 2016, 9:36:45 AM6/30/16
to TiddlyWiki
Hi Mark

Thanks for the radio idea. I think I would have to see an example that is more substantial than the one at tiddlywiki.com in order to implement the idea though. To answer your question: I usually use zoomin story view, so having on preview mode that changes every tiddler's view mode would be better. Also, default upon opening the file needs to be #4 (blank) to keep from slowing the file down. But default after the first use is not necessary.

Dave

Mark S.

unread,
Jun 30, 2016, 10:31:31 AM6/30/16
to TiddlyWiki
Here's an example. Unfortunately, there doesn't seem to be a way to force a default state for radio buttons. So the state will be whatever it was the last time the TW was opened. This is how it is with the TW "preview" mode as well, so I guess we should be used to it ... You could just put it in "blank" mode before closing.

I seem to recall that in the TWC there were "hooks" where you could put code that got executed when the page was first opened. Perhaps someone will know how to do the same thing here, so that the value of the stored state could be changed on boot-up.

HTH
Mark
Project_Dave1.json

David Gifford

unread,
Jun 30, 2016, 11:37:42 AM6/30/16
to TiddlyWiki
Hi Mark

Sorry for my ignorance, not sure what to do with a json file.

I managed to do this with the fieldmangler widget, which works quite nicely: http://giffmex.org/experiments/linkviewer.html

Dave

Mark S.

unread,
Jun 30, 2016, 11:44:16 AM6/30/16
to TiddlyWiki
You just drag and drop it into your TW -- it gives an import menu where you can approve the incoming tiddlers.

Mark

David Gifford

unread,
Jun 30, 2016, 1:35:23 PM6/30/16
to TiddlyWiki
Well, it wasn't as simple as that - I dragged and dropped it, and it imported as a link, which then opened with info for four tiddlers that needed a lot of /'s and /n's removed from before pasting them into tiddlers.

But when I got all that done, it worked nice! Thanks!

Dave

Eric Shulman

unread,
Jun 30, 2016, 1:57:53 PM6/30/16
to TiddlyWiki
On Thursday, June 30, 2016 at 10:35:23 AM UTC-7, David Gifford wrote:
Well, it wasn't as simple as that - I dragged and dropped it, and it imported as a link, which then opened with info for four tiddlers that needed a lot of /'s and /n's removed from before pasting them into tiddlers.

When you drop a json file onto an open TW, make sure that the green "drop here" bar appears.  If it doesn't, and you drop the json file, it will use standard browser handling that replaces the current TW document in the browser, and shows the source of the json file (which has HTML encoded content).

When the green bar *is* showing, dropping the json file starts the TW import process, unpacking the JSON and showing you a list of tiddlers to select/unselect before pressing the "import" button to import the selected tiddlers.

enjoy,
-e

David Gifford

unread,
Jun 30, 2016, 2:58:31 PM6/30/16
to tiddl...@googlegroups.com
ah, gotcha. Thanks Eric!

--
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/1IJQtdCllek/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 https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/dedb67c8-968a-4868-8e0a-69700fecfd43%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
David Gifford
Christian Reformed World Missions, Mexico City

David Gifford

unread,
Jun 30, 2016, 3:01:35 PM6/30/16
to TiddlyWiki
Hi everyone

Here is the final result, with the radials working.

http://giffmex.org/experiments/linkviewer.html

Dave
Reply all
Reply to author
Forward
0 new messages