Template:Title: Difference between revisions

From Shifti
Jump to navigation Jump to search
add some debugging to see why "name omitted" fails
m make this template immune to people using custom CSS to get first-line indents on paragraphs
 
(28 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{#ifeq: {{{name| }}} | |
{{#vardefine: auth  | {{#ifeq: {{NAMESPACE}} |User| {{{author|{{BASEPAGENAME}}}}} | {{{author| }}}}}}}<!--
  Blank Name
-->{{#vardefine: uname | {{#ifeq: {{NAMESPACE}} |User| {{{user|{{BASEPAGENAME}}}}} | {{{user|{{#var:auth}}}}}}}}}<!--
  {{#ifeq: {{{author| }}} | |
-->{{#vardefine: pname | {{#ifeq: {{NAMESPACE}} |User| {{{name|{{SUBPAGENAME}}}}} | {{{name|{{PAGENAME}}}}}}}}}<!--
    Blank Author
-->{{#vardefine: cauth | {{{coauthors| }}}}}<!--
    {{#ifeq:{{NAMESPACE}} |User|
--><span style="font-size: 150%; font-weight: bold; text-indent: 0em;">{{#var:pname}}{{Title tag|{{#var:pname}}}}</span><br/>
      Namespace is User
<span style="text-indent: 0em;">{{#ifeq: {{#var:cauth}} | |
      <span style="font-size: 132%;"><b>{{SUBPAGENAME}}</b></span><br/>Author: ''[[User:{{BASEPAGENAME}}|{{BASEPAGENAME}}]]'' |
  {{#ifeq: {{#var:auth}} | |
      Namespace isn't User
    {{#ifeq: {{#var:uname}} | ||
      <span style="font-size: 132%; font-weight: bold;">{{PAGENAME}}</span>
      Author: ''[[User:{{#var:uname}}|{{#var:uname}}]]'' {{Author tag|{{#var:uname}}}}
     }} |
     }} |  
    Author Given
     {{#ifeq: {{#var:uname}} | |
     {{#ifeq: {{{user| }}} | |
       Author: ''{{#var:auth}}'' |
      Blank Username
       Author: ''[[User:{{#var:uname}}|{{#var:auth}}]]'' {{Author tag|{{#var:auth}}}}
       Author: ''{{{author}}}'' |
      Username Given
       Author: ''[[User:{{{user}}}|{{{author}}}]]''
     }}
     }}
   }} |
   }} |
  Name Given 
   {{#ifeq: {{#var:auth}} | |
  <span style="font-size: 132%;"><b>{{{name}}}</b></span><br/>
     {{#ifeq: {{#var:uname}} | | Authors: ''{{#var:cauth}}'' |  
   {{#ifeq: {{{author| }}} | |
      Authors: ''[[User:{{#var:uname}}|{{#var:uname}}]] {{#var:cauth}}''
    Blank Author
     }} |  
     {{#ifeq: {{NAMESPACE}} |User|
     {{#ifeq: {{#var:uname}} | |
      User Namespace
       Authors: ''{{#var:auth}} {{#var:cauth}}''|
      Author: ''[[User:{{BASEPAGENAME}}|{{BASEPAGENAME}}]]'' |
       Author: ''[[User:{{#var:uname}}|{{#var:auth}}]] {{#var:cauth}}''
      Not User Namespace
      {{#ifeq: {{{user| }}} | |
        Blank User
        Author: ''{{{author}}}'' |
        User Given
        Author: ''[[User:{{{user}}}|{{{author}}}]]''
      }}
     }} |
    Author Given
     {{#ifeq: {{{user| }}} | |
       Blank User
      Author: ''{{{author}}}'' |
      User Given
       Author: ''[[USER:{{{user}}}|{{{author}}}]]''
     }}
     }}
   }}
   }}
}}<hr/><noinclude>
}} {{#if:{{{category|}}}| &mdash; see [[:Category:{{{category}}}|other works by this author]]}}</span><hr/><noinclude>
Usage: <nowiki>{{title|name=Story Title|author=Author Name|user=shifti user name}}</nowiki>
Usage:
:This generates a headerbar like you see above, with <nowiki>{{{name}}}, {{{author}}} and {{{user}}}</nowiki> values properly replaced. <nowiki>{{{user}}}</nowiki> 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]].
 
<pre>{{title
|name= Story Title
|author= Author Name
|user= shifti user name
|coauthors= extra authorship information
|category= name of author's category}}
</pre>
 
This generates a headerbar like you see above, with <nowiki>{{{name}}}, {{{author}}} and {{{user}}}</nowiki> values properly replaced. <nowiki>{{{user}}}</nowiki> 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]].
</noinclude>
</noinclude>

Latest revision as of 01:18, 15 February 2009

{{#ifeq: Template |User| Title | Title}}[[Title::{{#ifeq: Template |User| Title | Title}}| ]]
{{#ifeq: | |

 {{#ifeq: {{#ifeq: Template |User| Title |  }} | | 
   {{#ifeq: {{#ifeq: Template |User| Title | {{#ifeq: Template |User| Title |  }}}} | || 
     Author: [[User:{{#ifeq: Template |User| Title | {{#ifeq: Template |User| Title |  }}}}|{{#ifeq: Template |User| Title | {{#ifeq: Template |User| Title |  }}}}]] [[Author::{{#ifeq: Template |User| Title | {{#ifeq: Template |User| Title |  }}}}| ]]
   }} | 
   {{#ifeq: {{#ifeq: Template |User| Title | {{#ifeq: Template |User| Title |  }}}} | |
     Author: {{#ifeq: Template |User| Title |  }} |
     Author: [[User:{{#ifeq: Template |User| Title | {{#ifeq: Template |User| Title |  }}}}|{{#ifeq: Template |User| Title |  }}]] [[Author::{{#ifeq: Template |User| Title |  }}| ]]
   }}
 }} |
 {{#ifeq: {{#ifeq: Template |User| Title |  }} | |
   {{#ifeq: {{#ifeq: Template |User| Title | {{#ifeq: Template |User| Title |  }}}} | | Authors: ' | 
     Authors: [[User:{{#ifeq: Template |User| Title | {{#ifeq: Template |User| Title |  }}}}|{{#ifeq: Template |User| Title | {{#ifeq: Template |User| Title |  }}}}]] 
   }} | 
   {{#ifeq: {{#ifeq: Template |User| Title | {{#ifeq: Template |User| Title |  }}}} | |
     Authors: {{#ifeq: Template |User| Title |  }} |
     Author: [[User:{{#ifeq: Template |User| Title | {{#ifeq: Template |User| Title |  }}}}|{{#ifeq: Template |User| Title |  }}]] 
   }}
 }}

}} {{#if:| — see [[:Category:{{{category}}}|other works by this author]]}}


Usage:

{{title
|name= Story Title
|author= Author Name
|user= shifti user name
|coauthors= extra authorship information
|category= name of author's category}}

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.