How to control what gets "folded"

Hi. I am noticing that the “fold” command does not seem to apply to the bits of code I have tagged $:/tags/ViewTemplate. I am wondering if there is a way to include them in the tiddler fold.

Yes,

Look for an example when the folding is honoured and you will see how its done. For example we know when we fold the text field is folded away.

<<tag $:/tags/ViewTemplate>> show us the elements displayed in the view template. The text is displayed using $:/core/ui/ViewTemplate/body

Open $:/core/ui/ViewTemplate/body

You will see the content is wrapped in;

<$reveal tag="div" class="tc-tiddler-body" type="nomatch" stateTitle=<<folded-state>> text="hide" retain="yes" animate="yes">

Any thing here will be able to be folded

</$reveal>

So just wrap the content within your item displayed on the view template, with the above, and it too will respond to folding.

  • Do note the reveal also influences the html tag, class and animate
4 Likes

Incidentally I am interested in developing a better folding solution that would look the same, yet allow buttons to be created to show/hide different viewTemplate elements, including those also added via the $:/tags/ViewTemplate tag.

  • For example on a tiddler using Streams, or other addons, Hide the Body, or Hide the Streams display.
  • I would want this to be on either a global and/or local basis.

This sounds quite similar (at least on the global basis) to Dave Gifford’s Toggle! solution, which I have hacked quite a bit so that it includes my own view template items (as well as <<tag $:/tags/ViewTemplate>> itself, so that any other new custom elements are within reach).

-Springer

1 Like