Try this:
First, create a custom cascade tiddler (e.g., “MyTagTemplate/ViewTemplateBodyFilter”)
- Set the text content to:
[tag[MyTag]then[MyTagTemplate]]
This defines the mapping between your tag value and your custom template - Tag it with
$:/tags/ViewTemplateBodyFilter
This adds the definition to the View Template cascade - Add a
list-before
field with an empty value
This puts the definition first in the cascade, so it supercedes any other matching cascade filter
Then, create a custom template (e.g., “MyTagTemplate”) containing:
<style>
.something { width: 8em; height: 8em; border:2px solid black; float: right; }
.something h3, .something h4, .something h5 { text-align: center; font-weight: bold }
</style>
<div class="something">
<h3>{{!!first}}</h3>
<h4>{{!!second}}</h4>
<h5>{{!!count}}</h5>
</div>
{{||$:/core/ui/ViewTemplate/body/default}}
<div style="clear:both;"/>
Notes:
- I put the CSS definitions “inline” so that a separate stylesheet tiddler is not needed.
- The default body template is transcluded after the info box to show the normal tiddler content. Note the use of
||
in the transclusion. - I added a “clear:both;” at the end, so that the info box doesn’t spill out the bottom of the tiddler if the tiddler’s body content is shorter than the info box.
enjoy,
-e