So I've got various different characters of various different species and 
various different ways in which a character's name is displayed.  I'd like 
to format how a character's name is displayed by using the caption field of 
a character tiddler.  I'm using a macro that uses Tobias's setvars widget, 
and it works when I put the macro call into the caption field and manually 
enter the parameters for the species and names for the characters.

Here's how it's working (Other species will be added eventually):

\define name_output(species,first,second,third)
<$setvars twothreename="""(\$third$\ ? \$third$, $first$ $second$\) || 
\$second$, $first$\""" formatted_name="""(\$species$\ == \Human\ ? 
twothreename ) || (\$species$\ == \Bajoran\ ? \$first$ $second$\) || 
(\$species$\ == \Garbrini\ ? \$second$, $first$ $third$\) || \$first$\""">
<<formatted_name>>
</$setvars>
\end

Here are the fields in an example character tiddler:

caption: <<name_output Human John Brown Doe>>
species: Human

This works fine so far.  Here's what I'd like it to do.

   1. Pass the title of the character tiddler into a macro, parse the title 
   as a list, then pass the list to the name_output macro so I don't have to 
   manually add the name fields to a bunch of already made character tiddlers.
   2. Use the species field in the caption field.  <<name_output 
   {{!!species}} name1 name2 name3>> doesn't seem to work as it interprets the 
   species parameter as {{!!species}} rather than the value of the species 
   field, although <<name_output Human {{!!title}}>> doesn't have this problem.

Does anyone know how I can do this?

-- 
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/6b112b6c-8037-4806-bb13-8cca370eba18%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to