Difference between revisions of "Template:Forum/header"

From Yugipedia
Jump to: navigation, search
(oh hey look {{Ombox}} means less code here)
(add support for {{Forum}} and {{{index}}} - separating forum index designation from {{{1}}} will allow for cleaner logic once the forum indices are switched over to {{Forum}})
Line 2: Line 2:
 
| style = height: 3.5em; width: 100%; margin: 0;
 
| style = height: 3.5em; width: 100%; margin: 0;
 
| image = '''Forums:'''
 
| image = '''Forums:'''
| imageright = <span class="{{#ifeq:{{lc:{{{1}}}}}|index|hide}}" style="white-space: nowrap;">[{{fullurl:{{FULLPAGENAMEE}}|action=edit&section=new}} http://images.wikia.com/anime/en/images/4/4e/Forum_new.gif] [{{fullurl:{{FULLPAGENAMEE}}|action=edit&section=new}} Post]</span>
+
| imageright = <span class="{{#ifeq:{{lc:{{{1}}}}}|index|hide|{{#if:{{{index|}}}|hide}}}}" style="white-space: nowrap;">[{{fullurl:{{FULLPAGENAMEE}}|action=edit&section=new}} http://images.wikia.com/anime/en/images/4/4e/Forum_new.gif] [{{fullurl:{{FULLPAGENAMEE}}|action=edit&section=new}} Post]</span>
| text  = [[Forum:Index|Index]] '''''→''''' {{#switch:{{{1}}}|index=|Yu-Gi-Oh! Wiki Discussion=[[Forum:General Yu-Gi-Oh! Discussion|General Yu-Gi-Oh! Discussion]] '''''→'''''|[[Forum:{{{1}}}|{{{1}}}]] '''''→'''''}} {{PAGENAME}}{{#if:{{{2|}}}|<br />[[Forum:Index|Index]] '''''→''''' [[Forum:{{{2}}}|{{{2}}}]] '''''→''''' {{PAGENAME}}}}
+
| text  = [[Forum:Index|Index]] '''''→''''' {{#if:{{{index|}}}||{{#switch:{{{1}}}|index=|Yu-Gi-Oh! Wiki Discussion=[[Forum:General Yu-Gi-Oh! Discussion|General Yu-Gi-Oh! Discussion]] '''''→'''''|[[Forum:{{{1}}}|{{{1}}}]] '''''→'''''}}}} {{PAGENAME}}{{#if:{{{2|}}}|<br />[[Forum:Index|Index]] '''''→''''' [[Forum:{{{2}}}|{{{2}}}]] '''''→''''' {{PAGENAME}}}}
 
}}<includeonly>{{<!-- topic cats -->
 
}}<includeonly>{{<!-- topic cats -->
   #switch: {{{1}}} | index = [[Category:Forums|{{PAGENAME}}]] | Yu-Gi-Oh! Wiki Discussion =  [[Category:General Yu-Gi-Oh! Discussion|{{PAGENAME}}]]__NEWSECTIONLINK__ | [[Category:{{{1}}}|{{PAGENAME}}]]__NEWSECTIONLINK__
+
   #if: {{{index|}}}
 +
  | [[Category:Forums|{{PAGENAME}}]]
 +
  | {{
 +
    #switch: {{{1}}} | index = [[Category:Forums|{{PAGENAME}}]] | Yu-Gi-Oh! Wiki Discussion =  [[Category:General Yu-Gi-Oh! Discussion|{{PAGENAME}}]]__NEWSECTIONLINK__ | [[Category:{{{1}}}|{{PAGENAME}}]]__NEWSECTIONLINK__
 +
  }}
 
}}{{
 
}}{{
 
   #if: {{{2|}}} | [[Category:{{{2}}}|{{PAGENAME}}]]
 
   #if: {{{2|}}} | [[Category:{{{2}}}|{{PAGENAME}}]]
Line 11: Line 15:
 
   #if: {{{sticky|}}} | [[Category:Sticky threads|{{PAGENAME}}]]
 
   #if: {{{sticky|}}} | [[Category:Sticky threads|{{PAGENAME}}]]
 
}}</includeonly>{{
 
}}</includeonly>{{
   #ifeq: {{#titleparts:{{FULLPAGENAME}}|1|1}} | Template:Forumheader
+
   #switch: {{#titleparts:{{FULLPAGENAME}}|1|1}} | Template:Forumheader | Template:Forum
 
   | <!-- no maintenance cats for Template:Forumheader or any subtemplates, though we are going to do a bit else here -->{{
 
   | <!-- no maintenance cats for Template:Forumheader or any subtemplates, though we are going to do a bit else here -->{{
 
     #switch: {{PAGENAME}}
 
     #switch: {{PAGENAME}}
     | Forumheader  | Forumheader/doc  | Forumheader/sandbox  | Forumheader/testcases =  
+
     | Forumheader  | Forumheader/doc  | Forumheader/sandbox  | Forumheader/testcases | Forum =  
 
     | #default = [[Category:Forumheader preload templates|{{SUBPAGENAME}}]]<!-- keep track of the preload templates -->
 
     | #default = [[Category:Forumheader preload templates|{{SUBPAGENAME}}]]<!-- keep track of the preload templates -->
 
   }}
 
   }}
Line 25: Line 29:
 
     | [[Category:Forumheader transclusions to be checked|P]]<!-- see if {{{3}}}-{{{5}}} are used anywhere and if so how -->
 
     | [[Category:Forumheader transclusions to be checked|P]]<!-- see if {{{3}}}-{{{5}}} are used anywhere and if so how -->
 
   }}{{
 
   }}{{
     #switch: {{{1|¬}}}
+
     #if: {{{index|}}}
    | ¬ = [[Category:Forumheader transclusions to be checked|U]]<!-- {{{1}}} not used (bad for obvious reasons) -->
+
    | <!-- forum index page; no further parameter checking necessary -->
    |  = [[Category:Forumheader transclusions to be checked|E]]<!-- {{{1}}} empty -->
+
    | {{
    | Help desk | General Yu-Gi-Oh! Discussion | Yu-Gi-Oh! Wiki Community Discussion | Yu-Gi-Oh! Deck Help | Yu-Gi-Oh! Ruling Queries | Yu-Gi-Oh! Lists Discussion | Duel Terminal | Weekly Deck Competition | Yu-Gi-Oh! Wiki Discussion | index = <!-- valid value -->
+
      #switch: {{{1|¬}}}
    | #default = [[Category:Forumheader transclusions to be checked|I]]<!-- invalid value -->
+
      | ¬ = [[Category:Forumheader transclusions to be checked|U]]<!-- {{{1}}} not used (bad for obvious reasons) -->
  }}{{
+
      |  = [[Category:Forumheader transclusions to be checked|E]]<!-- {{{1}}} empty -->
    #switch: {{{2|¬}}}
+
      | Help desk | General Yu-Gi-Oh! Discussion | Yu-Gi-Oh! Wiki Community Discussion | Yu-Gi-Oh! Deck Help | Yu-Gi-Oh! Ruling Queries | Yu-Gi-Oh! Lists Discussion | Duel Terminal | Weekly Deck Competition | Yu-Gi-Oh! Wiki Discussion | index = <!-- valid value -->
    |  = [[Category:Forumheader transclusions to be checked|E]]<!-- {{{2}}} empty -->
+
      | #default = [[Category:Forumheader transclusions to be checked|I]]<!-- invalid value -->
    | ¬ | Help desk | General Yu-Gi-Oh! Discussion | Yu-Gi-Oh! Wiki Community Discussion | Yu-Gi-Oh! Deck Help | Yu-Gi-Oh! Ruling Queries | Yu-Gi-Oh! Lists Discussion | Duel Terminal | Weekly Deck Competition | Yu-Gi-Oh! Wiki Discussion | index = <!-- valid value or unused -->
+
    }}{{
    | #default = [[Category:Forumheader transclusions to be checked|I]]<!-- invalid value -->
+
      #switch: {{{2|¬}}}
 +
      |  = [[Category:Forumheader transclusions to be checked|E]]<!-- {{{2}}} empty -->
 +
      | ¬ | Help desk | General Yu-Gi-Oh! Discussion | Yu-Gi-Oh! Wiki Community Discussion | Yu-Gi-Oh! Deck Help | Yu-Gi-Oh! Ruling Queries | Yu-Gi-Oh! Lists Discussion | Duel Terminal | Weekly Deck Competition | Yu-Gi-Oh! Wiki Discussion | index = <!-- valid value or unused -->
 +
      | #default = [[Category:Forumheader transclusions to be checked|I]]<!-- invalid value -->
 +
    }}
 
   }}
 
   }}
 
}}<noinclude>
 
}}<noinclude>
 
[[Category:Forums|{{PAGENAME}}]]
 
[[Category:Forums|{{PAGENAME}}]]
 
</noinclude>
 
</noinclude>

Revision as of 07:14, 13 August 2010