Template:Title: Difference between revisions

From Shifti
Jump to navigation Jump to search
add some debugging to see why "name omitted" fails
No edit summary
Line 1: Line 1:
{{#ifeq: {{{name| }}} | |
{{#ifeq: {{{name| }}} | |
  Blank Name
   {{#ifeq: {{{author| }}} | |
   {{#ifeq: {{{author| }}} | |
    Blank Author
     {{#ifeq:{{NAMESPACE}} |User|
     {{#ifeq:{{NAMESPACE}} |User|
      Namespace is User
       <span style="font-size: 132%;"><b>{{SUBPAGENAME}}</b></span><br/>Author: ''[[User:{{BASEPAGENAME}}|{{BASEPAGENAME}}]]'' |
       <span style="font-size: 132%;"><b>{{SUBPAGENAME}}</b></span><br/>Author: ''[[User:{{BASEPAGENAME}}|{{BASEPAGENAME}}]]'' |
      Namespace isn't User
       <span style="font-size: 132%; font-weight: bold;">{{PAGENAME}}</span>
       <span style="font-size: 132%; font-weight: bold;">{{PAGENAME}}</span>
     }} |
     }} |
     Author Given
     <span style="font-size: 132%;"><b>{{{title}}}</b></span><br/>
     {{#ifeq: {{{user| }}} | |
     {{#ifeq: {{{user| }}} | |
      Blank Username
       Author: ''{{{author}}}'' |
       Author: ''{{{author}}}'' |
      Username Given
       Author: ''[[User:{{{user}}}|{{{author}}}]]''
       Author: ''[[User:{{{user}}}|{{{author}}}]]''
     }}
     }}
   }} |
   }} |
  Name Given 
   <span style="font-size: 132%;"><b>{{{name}}}</b></span><br/>
   <span style="font-size: 132%;"><b>{{{name}}}</b></span><br/>
   {{#ifeq: {{{author| }}} | |
   {{#ifeq: {{{author| }}} | |
    Blank Author
     {{#ifeq: {{NAMESPACE}} |User|
     {{#ifeq: {{NAMESPACE}} |User|
      User Namespace
       Author: ''[[User:{{BASEPAGENAME}}|{{BASEPAGENAME}}]]'' |
       Author: ''[[User:{{BASEPAGENAME}}|{{BASEPAGENAME}}]]'' |
      Not User Namespace
       {{#ifeq: {{{user| }}} | |
       {{#ifeq: {{{user| }}} | |
        Blank User
         Author: ''{{{author}}}'' |
         Author: ''{{{author}}}'' |
        User Given
         Author: ''[[User:{{{user}}}|{{{author}}}]]''
         Author: ''[[User:{{{user}}}|{{{author}}}]]''
       }}
       }}
     }} |
     }} |
    Author Given
     {{#ifeq: {{{user| }}} | |
     {{#ifeq: {{{user| }}} | |
      Blank User
       Author: ''{{{author}}}'' |
       Author: ''{{{author}}}'' |
      User Given
       Author: ''[[USER:{{{user}}}|{{{author}}}]]''
       Author: ''[[USER:{{{user}}}|{{{author}}}]]''
     }}
     }}

Revision as of 22:03, 22 July 2007

{{#ifeq: | |

 {{#ifeq:   | |
   {{#ifeq:Template |User|
     Title
Author: Title | Title }} | {{{title}}}
{{#ifeq: | | Author: {{{author}}} | Author: [[User:{{{user}}}|{{{author}}}]] }} }} | {{{name}}}
{{#ifeq: | | {{#ifeq: Template |User| Author: Title | {{#ifeq: | | Author: {{{author}}} | Author: [[User:{{{user}}}|{{{author}}}]] }} }} | {{#ifeq: | | Author: {{{author}}} | 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.