I'd need a small macro with no other purpose than putting a specified text to lower/upper case. I am sure this isn't difficult to implement; nevertheless I require your help.
@@text-transform: uppercase;test this@@
@@text-transform: lowercase;TEST THIS@@
\define lower(text)
@@text-transform: lowercase;$text$@@
\end
\define upper(text)
@@text-transform: uppercase;$text$@@
\end<<lower "This TEXT will APPear in ALL LoWeR case">>
<<upper "This TEXT will APPear in ALL UpPeR case">>
\define TableHeaders()
<$list filter="[is[current]split:table-headers[,]]" variable="currentField"><th><$set name="currentFieldSet" value=<<currentField>> ><$button class="tc-btn-invisible" set="!!sort-field" setTo=<<lower $(currentFieldSet)$>> > <<currentField>> </$button></$set></th></$list>
\end
\define lower(text)
@@text-transform: lowercase;$text$@@
\end
\define TableHeaders()
<$list filter="[is[current]split:table-headers[,]]" variable="currentField"><th><$button class="tc-btn-invisible" set="!!sort-field" setTo=<<lowerSortField text="<<currentField>>">> ><<currentField>></$button></th></$list>
\end
\define lower(text)
@@text-transform: lowercase;$text$@@
\end
\define lowerSortField(text)
<<lower $text$>>
\end
\define TableHeaders()
<$list filter="[is[current]split:table-headers[,]]" variable="currentField"><th><$set name="currentFieldSet" value=<<currentField>> ><$button class="tc-btn-invisible" set="!!sort-field" setTo=<<lowerSortField>> ><<currentField>></$button></$set></th></$list>
\end
\define lower(text)
@@text-transform: lowercase;$text$@@
\end
\define lowerSortField()
<<lower $(currentFieldSet)$>>
\end
/*\
title: $:/_my/macros/setlowercase.js
type: application/javascript
module-type: macro
Macro to set a text string to lower case
\*/
(function(){
/*jslint node: true, browser: true */
/*global $tw: false */
"use strict";
/*
Information about this macro
*/
exports.name = "setlowercase";
exports.params = [
{name: "title"}
];
/*
Run the macro
*/
exports.run = function(title) {
return title.toLowerCase();
};
})();
usage:
<<setlowercase "TextTo Change Case">>\define lower(text)
@@text-transform: lowercase;$text$@@
\end
\define lower2()
<$macrocall $name="lower" text=$(setsort)$/>
\end
<$set name="setsort" value="Rand" >
<<lower2>>
</$set>
<$button set="!!somefield" setTo=Rand/> in the somefield field).
<$set name="setsort" value="Rand" >
<$button set="!!somefield" setTo=<<lower2>>/>
</$set>But this can't be the only problem, since replacing the css and using c pa's macro (see above) doesn't change anything. The resulting value of the somefield field is still the non-evaluated macro call. Or wasn't it this macro type you are speaking of?
\define lower2()
<$macrocall $name="setlowercase" title="$(setsort)$"/>
\end
<$set name="setsort" value="Rand" >
<$button set="!!somefield" setTo=<<lower2>>/>
</$set>