Remove viewtemplate items conditionally Q

106 views
Skip to first unread message

David Gifford

unread,
Aug 11, 2016, 9:08:49 AM8/11/16
to tiddl...@googlegroups.com
Hi all,

I am playing around again. I am wondering in a general way what the most efficient way of doing the following would be:

I want to have two types of tiddlers, topics and notes. Topic tiddlers would display normally, with titles and buttons. Note tiddlers would display only the tiddler text. (I would put a tiny click to edit button somewhere in case I need to edit it later). Since the topic tiddlers will be far fewer, I was thinking about having them tagged Topic to distinguish them.

So I need to create some kind of setup where certain viewtemplate items are NOT viewed, but only on tiddlers that are not tagged Topic or that are tagged Note. Except I am not sure how to do this?

(The idea, in case you are wondering, is to use an 'open all' button in the tag template to open all the tiddlers tagged with a topic. The tiddlers would be the notes, so that is why I don't want to see anything but the text. I would also use the seamless theme to remove the space between tiddlers. Then I would have a more strategically placed 'close all' button to close them again.)

Any ideas?

Dave

Jed Carty

unread,
Aug 11, 2016, 12:14:24 PM8/11/16
to TiddlyWiki
I think that the only way to do this would be to remove the $:/tags/ViewTemplate tag from all the core view templates you don't want on every tiddler and make conditional view templates that add the parts you want based on your tags.

If there is another way to remove pieces of a view template I don't know it. Because of how tiddlywiki is built I don't think there is a way to do it without getting into weird css tricks.

Jeremy Ruston

unread,
Aug 11, 2016, 12:29:32 PM8/11/16
to tiddl...@googlegroups.com
Wouldn’t it be possible using a stylesheet something like this?

.tc-tagged-Note .tc-tiddler-title,
.tc-tagged-Note .tc-subtitle {
display:none;
}

Best wishes

Jeremy


> On 11 Aug 2016, at 17:14, Jed Carty <inmy...@gmail.com> wrote:
>
> I think that the only way to do this would be to remove the $:/tags/ViewTemplate tag from all the core view templates you don't want on every tiddler and make conditional view templates that add the parts you want based on your tags.
>
> If there is another way to remove pieces of a view template I don't know it. Because of how tiddlywiki is built I don't think there is a way to do it without getting into weird css tricks.
>
> --
> 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 https://groups.google.com/group/tiddlywiki.
> To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/23d146e3-29c6-4e30-a15f-7b1fbe90cc37%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

PMario

unread,
Aug 11, 2016, 1:21:29 PM8/11/16
to tiddl...@googlegroups.com
Hi,

Jeremy was faster :) ... but I did also create some buttons :)

Drag the following json file into tiddlywiki.com and see how it works. Explanation should follow :)

I did use "TableOfContents" as the tag, to make it easily testable with tiddlywiki.com ... So you need to adjust this with eg: Note :)

have fun!
-mario

PS: While creating this post, I had a different idea. ... So something even easier may follow.

toggle-stylesheet-with-buttons-macros.json

David Gifford

unread,
Aug 11, 2016, 3:52:41 PM8/11/16
to TiddlyWiki
Thanks everyone!

Jeremy was indeed faster, but I actually was thinking along the lines of a toggle button, so I have modified and will use that. Thanks!

Dave
Reply all
Reply to author
Forward
0 new messages