Hi Thomas

Thank you very much for answering :-)
If I do it like this:

\define he-she-it(gendervalue:"_false_") 
<$vars value="""$gendervalue$"""> 
<$set name="result" filter="[<value>!prefix[_false_]]" value=<<value>> 
emptyValue="it" > 
<<result>> 
</$set> 
</$vars> 
\end 

<$checkbox field="gender" checked="he" unchecked="she"><<he-she-it 
{{!!gender}}>></$checkbox>


Nothing is shown when the field is either empty or doesn't exist.
It shows "he" when "he" is the value and "she" if "she" is the value.
It doesn't seem to do anything except rendering the fieldvalue when I use 
it like this..

Actually I don't need the neutral state - just: he, she, He, She, his, her. 
His Her computed from the state value (true or false) of a field (gender) 
(If the field does not exist a default value like: "gender not known" would 
suffice.

For convience I want to use short macros like <<g>>, <<G>>, <<g's>> and 
<<G's>> to render different results..

To me it seems like it should/would be some very simple (understandable) 
macro I should be able to string together with a few conditional "if's" 
here and there and wikitext... 
However I've been trying to do this in a TW for some years now - and I 
always have to give up because it gets to complicated for my (brain) usage 
:-) 
It always ends up with shooting sparrows with cannons eg: using Library 
tiddlers and what not ...

Thank you for trying to help me out - even if I don't understand the macro 
definition you posted :-)

Cheers Måns Mårtensson



Den lørdag den 8. april 2017 kl. 14.20.36 UTC+2 skrev Thomas Elmiger:
>
> Forgot to mention: my solution works, if you store "he" or "she" as values 
> in the field "gender" and call my macro with this value as a parameter. 
>
> Of course this solves only one of your questions but maybe it helps as a 
> starting point. 
>

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@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/54cc1e02-44a2-45c9-a0f1-c920cf82578a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to