Nick,
Spelling out the solution merely gestured-at above:
Suppose I have a dynamic-table column for the bibtex-year
field, and I always want the dynamic-table column’s header to be just year
(which I do!) … or 📘year
or whatever.
On my solution: I make a tiddler called bibtex-year
and give it a tbl_caption
field with contents: year
.
I can do this, on the fly, for any column header, without messing around each time with templates. Column headers still default to their usual field names.
If you like this behavior, you just have to edit Shiraz’s shadow tiddler for default column headers as follows:
title: $:/plugins/kookma/shiraz/templates/header/default
<$reveal type="nomatch" stateTitle=<<tempTableSort>> stateIndex="sortIndex" text=<<currentColumn>> tag="th">
<$button setTitle=<<tempTableSort>> setIndex="sortIndex" setTo=<<currentColumn>> class="tc-btn-invisible tc-tiddlylink" >
<$action-setfield $tiddler=<<tempTableSort>> $index="hasnegate" $value="false"/>
<$action-setfield $tiddler=<<tempTableSort>> $index="negate" $value=""/>
<span style="text-transform: capitalize;"><$transclude tiddler=<<currentColumn>> field="tbl_caption"> <<currentColumn>> </$transclude></span>
</$button>
</$reveal>
<$reveal type="match" stateTitle=<<tempTableSort>> stateIndex="sortIndex" text=<<currentColumn>> tag="th">
<$list filter="[<tempTableSort>getindex[hasnegate]match[false]]" variable=ignore><!--set negate for sort-->
<$button setTitle=<<tempTableSort>> setIndex="hasnegate" setTo="true" class="tbl-sort-svg tc-btn-invisible tc-tiddlylink" >
<$action-setfield $tiddler=<<tempTableSort>> $index="negate" $value="!"/>
<span style="text-transform: capitalize;"><$transclude tiddler=<<currentColumn>> field="tbl_caption"> <<currentColumn>> </$transclude></span> {{$:/core/images/down-arrow}}
</$button>
</$list>
<$list filter="[<tempTableSort>getindex[hasnegate]match[true]]" variable=ignore><!--remove negate for sort-->
<$button setTitle=<<tempTableSort>> setIndex="hasnegate" setTo="false" class="tbl-sort-svg tc-btn-invisible tc-tiddlylink" >
<$action-setfield $tiddler=<<tempTableSort>> $index="negate" $value=""/>
<span style="text-transform: capitalize;"><$transclude tiddler=<<currentColumn>> field="tbl_caption"> <<currentColumn>> </$transclude></span> {{$:/core/images/up-arrow}}
</$button>
</$list>
</$reveal>
To be clearer (so that the suggestion survives Shiraz updates) just replace each occurrence of
<span style="text-transform: capitalize;"><$text text=<<currentColumn>>/></span>
with
<span style="text-transform: capitalize;"><$transclude tiddler=<<currentColumn>> field="tbl_caption"> <<currentColumn>> </$transclude></span>