Hi Mans 1. create a new tiddler and name this 'male' 2. create a new tiddler and name this 'female' 3. set the type of both of these tiddlers to 'data dictionary' 4. in the text field of 'male' make entries like: gender1:him gender2:Him gender3:Mr ... and so on 5. in the text field of 'female' make entries like: gender1:her gender2:Her gender3:Mrs ... and so on 6. when you want 'him' -- you can use the text reference {{male##gender1}} ... and so on 7. when you want 'her' -- you can use the text reference {{female##gender1}} ... and so on
I think in your use case you would want a variable as the name of the data tiddler -- so references might look something like {{$gender$##gender1}}, where the variable takes the value 'male' or 'female' as appropriate. I think you'll need a macro call to insert the variable before using the text-reference as the syntax I've used above won't work (this was for illustration only.) regards On Friday, June 20, 2014 8:28:40 PM UTC+2, Måns wrote: > > Hi Matabele > > >> The variations of gender could be looked up in two data tables 'male' and >> 'female', in such a way that: >> >> male##gender1 --> him >> female##gender1 --> her >> male##gender2 --> Him >> female##gender2 --> Her >> > > > >> all variations of gender are text-reference lookups using either 'male' >> or 'female' (the titles of the two data tables) as the only variable >> > > I think I understand what you are saying - however I don't have a clue how > I should set it up... > > Could you perhaps write a small example - in a TW5 - or point to a similar > practical example which might give me an idea how to implement it myself? > > Cheers Måns Mårtensson > > >> On Friday, June 20, 2014 6:51:51 PM UTC+2, Måns wrote: >>> >>> Hi Matabele >>> >>> My actual usecase is that I use two radio 'buttons' to toggle the value >>> of one field 'gender' between "him" or "her" >>> >>> Because I need different variations on "him" or "her" I need to be able >>> to more fields at once - with different versions - eg. "Him", "he", "He" >>> and "her", "Her", "she", "She" etc... >>> >>> This way I can use eg.: {{!!gender}}, {{!!gender2}}, {{!!gender3}} in my >>> text templates. >>> >>> Imo - it seems to be an 'overkill' if you have to set all variations >>> with a radio button for each individual variation every time you use the >>> template... >>> >>> Maybe there's a better way to control this via some kind of aliassing - >>> don't know...? >>> >>> Cheers Måns Mårtensson >>> >>> >>> Den fredag den 20. juni 2014 13.57.09 UTC+2 skrev Matabele: >>>> >>>> Hi Mans >>>> >>>> The radio 'button' reports on the value of a field -- it is checked if >>>> the value matches and unchecked if it does not. This behaviour is not >>>> compatible with a radio 'button' that sets the value of multiple fields. >>>> >>>> I'm not sure what the best avenue is to take with this king of use case >>>> -- my current idea is to create a widget that sends one widget message >>>> upon >>>> being checked and another upon being unchecked. This would allow several >>>> fields to be toggled between two values using two stacks of <$setfield> >>>> widgets around a button. >>>> >>>> I think the usage I had in mind differed -- this was to list a number >>>> of tiddlers according to some filter expression, then toggle the value of >>>> a >>>> field between two values for all tiddlers in the list. >>>> >>>> I don't know if either of these tactics (or some other tactic) is best >>>> suited to your needs. >>>> >>>> regards >>>> >>>> On Friday, June 20, 2014 1:00:07 AM UTC+2, Måns wrote: >>>>> >>>>> Hi Matabele >>>>> >>>>> >>>>> Does Setfield widget work with radiobuttons? >>>>> >>>>> I tried this to no avail: >>>>> >>>>> <$setfield set="!!gender2c" setTo="Han"> >>>>> <$setfield set="!!gender2" setTo="han"> >>>>> <$setfield set="!!genderc" setTo="Ham"> >>>>> <$radio field="gender" value="ham"> dreng</$radio> >>>>> </$setfield></$setfield></$setfield> >>>>> >>>>> <$setfield set="!!gender2c" setTo="Hun"> >>>>> <$setfield set="!!gender2" setTo="hun"> >>>>> <$setfield set="!!genderc" setTo="Hendes"> >>>>> <$radio field="gender" value="hende"> pige</$radio> >>>>> </$setfield></$setfield></$setfield> >>>>> >>>>> I think it would be very nice if the widget did work with radio >>>>> buttons and even checkmarks. >>>>> >>>>> Cheers Måns Mårtensson >>>>> >>>> -- 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 http://groups.google.com/group/tiddlywiki. For more options, visit https://groups.google.com/d/optout.