Template:LiteraryForm: Difference between revisions

From Wikisum
No edit summary
Line 11: Line 11:
     | plural = essays
     | plural = essays
     | #default = an essay
     | #default = an essay
  }}
| novel = {{#switch: {{{2|}}}
    | title = a novel
    | Title = a Novel
    | plural = novels
    | #default = a novel
  }}
| play = {{#switch: {{{2|}}}
    | title = a play
    | Title = a Play
    | plural = plays
    | #default = a play
  }}
| poem = {{#switch: {{{2|}}}
    | title = a poem
    | Title = a Poem
    | plural = poems
    | #default = a poem
   }}
   }}
| #default = {{#ifeq: {{{2|}}}|plural|books|a book}}
| #default = {{#ifeq: {{{2|}}}|plural|books|a book}}
}}</includeonly><noinclude>
}}</includeonly>
This template takes a user input literary form and the format expected (for title or for categories) and returns the corresponding value or nothing if the genre is not in the table.
 
Usage:
{{LiteraryForm|user input|format}}
 
Example:
{{LiteraryForm|short story|Title}} will return "a Short Story"
{{LiteraryForm|essay|plural}} will return "essays"
</noinclude>

Revision as of 18:34, 24 May 2023