Template:Title

From Shifti
Revision as of 21:59, 22 July 2007 by ShadowWolf (talk | contribs) (add some debugging to see why "name omitted" fails)
Jump to navigation Jump to search

{{#ifeq: | |

 Blank Name
 {{#ifeq:   | |
   Blank Author
   {{#ifeq:Template |User|
     Namespace is User
     Title
Author: Title | Namespace isn't User Title }} | Author Given {{#ifeq: | | Blank Username Author: {{{author}}} | Username Given Author: [[User:{{{user}}}|{{{author}}}]] }} }} | Name Given {{{name}}}
{{#ifeq: | | Blank Author {{#ifeq: Template |User| User Namespace Author: Title | Not User Namespace {{#ifeq: | | Blank User Author: {{{author}}} | User Given Author: [[User:{{{user}}}|{{{author}}}]] }} }} | Author Given {{#ifeq: | | Blank User Author: {{{author}}} | User Given Author: [[USER:{{{user}}}|{{{author}}}]] }} }}

}}


Usage: {{title|name=Story Title|author=Author Name|user=shifti user name}}

This generates a headerbar like you see above, with {{{name}}}, {{{author}}} and {{{user}}} values properly replaced. {{{user}}} is used to generate a link back to the authors user page. Any of the parameters can be omitted - in fact, on a page that is a sub-page of a user page they can be omitted entirely and the header will still be be properly generated. On other pages omission of all the parameters will result in only the addition of the story title. For an example of what all of the preceding means, take a look at User:ShadowWolf/Test Page.