more wikis
 

Forum:Help regarding a template code

Wikia - creating communities

Forums: Index
Help desk
Help regarding a template code
Wikia's forums are a place for the community to help other members. Staff do visit, but if you require staff help, please use Special:Contact to be sure of a reply.


I found this wiki on football and while going through cleaning stuff up I came across a template which was clearly taken from Wikipedia anyway their seems to be a slight coding problem with it concerning the kit layout part of it which seems to just not want to work so I was hoping if anyone could help fix the problem before I go out of my mind editing every bit to no luck. I added the code below if that helps but the main page is [1] --TheWho87 10:16, 15 May 2009 (UTC)

{| class="infobox vcard" cellspacing="5" style="font-size: 90%; text-align: left; width: 25em" 
| colspan="2" style="text-align: center; font-size: 130%; font-weight: bold;" class="fn org" | {{{title|{{{clubname|{{PAGENAME}}}}}}}}
|-
{{#if:{{{image|}}}|
{{!}} colspan="2" style="text-align: center;" {{!}} {{{image|}}}
{{!}}-
}}
! [[Football club names|Full name]]
{{!}} {{{fullname|{{PAGENAME}}}}}
{{!}}-
{{#if:{{{nickname|}}}|
! Nickname(s)
{{!}} {{{nickname|}}}
{{!}}-
}}
{{#if:{{{shortname|}}}|
! Short name
{{!}} {{{shortname|}}}
{{!}}-
}}
! Founded
{{!}} {{{founded|Unknown}}}
{{!}}-
{{#if:{{{dissolved|}}}|
! Dissolved
{{!}} {{{dissolved|}}}
{{!}}-
}}
! {{#if:{{{American|}}}|Stadium|Ground}}
{{!}} {{{ground|None}}}{{#if:{{{capacity|}}}|<br>([[List of football stadiums by capacity|Capacity]]: {{{capacity|unknown}}})}}
{{!}}-
{{#if:{{{owner|}}}|
! {{{chrtitle|Owner}}}
{{!}} {{{owner|}}}
{{!}}-
}}
{{#if:{{{chairman|}}}|
! {{{chrtitle|Chairman}}}
{{!}} {{{chairman|}}}
{{!}}-
}}
{{#if:{{{manager|}}}|
! {{{mgrtitle|Manager}}}
{{!}} {{{manager|}}}
{{!}}-
}}
{{#if:{{{coach|}}}|
! Coach
{{!}} {{{coach|}}}
{{!}}-
}}
{{#if:{{{league|}}}|
! League
{{!}} {{{league|}}}
{{!}}-
}}
{{#if:{{{season|}}}|
! {{{season|}}}
{{!}} {{{position|}}}
{{!}}-
}}
{{#if:{{{website|}}}|
! Website
{{!}} [{{{website|}}} Club home page]
{{!}}-
}}
{{#if:{{{firstgame|}}}|
! First game
{{!}} {{{firstgame|}}}
{{!}}-
}}
{{#if:{{{largestwin|}}}|
! Largest win
{{!}} {{{largestwin|}}}
{{!}}-
}}
{{#if:{{{worstdefeat|}}}|
! Largest defeat
{{!}} {{{worstdefeat|}}}
{{!}}-
}}
{{#if:{{{topscorer|}}}|
! All-time top scorer
{{!}} {{{topscorer|}}}
{{!}}-
}}
{{#if:{{{fansgroup|}}}|
! Supporters groups
{{!}} {{{fansgroup|}}}
{{!}}-
}}
{{#if:{{{honours|}}}|
! {{#if:{{{American|}}}|Honors|Honours}}
{{!}} {{{honours|}}}
{{!}}-
}}
{{#if:{{{pattern_la1|}}}{{{pattern_b1|}}}{{{pattern_ra1|}}}{{{pattern_sh1|}}}{{{pattern_so1|}}}{{{leftarm1|}}}{{{body1|}}}{{{rightarm1|}}}{{{shorts1|}}}{{{socks1|}}} {{{pattern_la2|}}}{{{pattern_b2|}}}{{{pattern_ra2|}}}{{{pattern_sh2|}}}{{{pattern_so2|}}}{{{leftarm2|}}}{{{body2|}}}{{{rightarm2|}}}{{{shorts2|}}}{{{socks2|}}}{{{pattern_la3|}}}{{{pattern_b3|}}}{{{pattern_ra3|}}}{{{pattern_sh3|}}}{{{pattern_so3|}}}{{{leftarm3|}}}{{{body3|}}}{{{rightarm3|}}}{{{shorts3|}}}{{{socks3|}}}|
<tr><td class="toccolours" style="padding: 0; background: #ffffff; text-align: center;" colspan="2">
<table style="width:100%; text-align:center;">
<tr>
{{#if:{{{pattern_la1|}}}{{{pattern_b1|}}}{{{pattern_ra1|}}}{{{pattern_sh1|}}}{{{pattern_so1|}}}{{{leftarm1|}}}{{{body1|}}}{{{rightarm1|}}}{{{shorts1|}}}{{{socks1|}}}|
<td>{{Football kit |
  pattern_la = {{{pattern_la1|}}} |
  pattern_b  = {{{pattern_b1|_unknown}}} |
  pattern_ra = {{{pattern_ra1|}}} |
  pattern_sh = {{{pattern_sh1|}}} |
  pattern_so = {{{pattern_so1|}}} |
  leftarm    = {{{leftarm1|}}} |
  body       = {{{body1|}}} |
  rightarm   = {{{rightarm1|}}} |
  shorts     = {{{shorts1|}}} |
  socks      = {{{socks1|}}} |
  title      = {{{pattern_name1|Home}}} {{#if:{{{American|}}}|colors|colours}}
}}</td>
}}{{#if:{{{pattern_la2|}}}{{{pattern_b2|}}}{{{pattern_ra2|}}}{{{pattern_sh2|}}}{{{pattern_so2|}}}{{{leftarm2|}}}{{{body2|}}}{{{rightarm2|}}}{{{shorts2|}}}{{{socks2|}}}|
<td>{{Football kit |
  pattern_la = {{{pattern_la2|}}} |
  pattern_b  = {{{pattern_b2|_unknown}}} |
  pattern_ra = {{{pattern_ra2|}}} |
  pattern_sh = {{{pattern_sh2|}}} |
  pattern_so = {{{pattern_so2|}}} |
  leftarm    = {{{leftarm2|}}} |
  body       = {{{body2|}}} |
  rightarm   = {{{rightarm2|}}} |
  shorts     = {{{shorts2|}}} |
  socks      = {{{socks2|}}} |
  title      = {{{pattern_name2|Away}}} {{#if:{{{American|}}}|colors|colours}}
}}</td>
}}{{#if:{{{pattern_la3|}}}{{{pattern_b3|}}}{{{pattern_ra3|}}}{{{pattern_sh3|}}}{{{pattern_so3|}}}{{{leftarm3|}}}{{{body3|}}}{{{rightarm3|}}}{{{shorts3|}}}{{{socks3|}}}|
<td>{{Football kit |
  pattern_la = {{{pattern_la3|}}} |
  pattern_b  = {{{pattern_b3|_unknown}}} |
  pattern_ra = {{{pattern_ra3|}}} |
  pattern_sh = {{{pattern_sh3|}}} |
  pattern_so = {{{pattern_so3|}}} |
  leftarm    = {{{leftarm3|}}} |
  body       = {{{body3|}}} |
  rightarm   = {{{rightarm3|}}} |
  shorts     = {{{shorts3|}}} |
  socks      = {{{socks3|}}} |
  title      = {{{pattern_name3|Third}}} {{#if:{{{American|}}}|colors|colours}}
}}</td>
}}</tr>
</table></td></tr>}}
{{#if:{{{current|}}}|
{{!}} colspan="2" style="text-align: center;" {{!}} [[Image:Soccerball current event.svg|33px|]] ''[[{{{current|}}}{{!}}Current season]]''
{{!}}-
}}
|}
Every time you use an {{#if: ... }} to wrap around a table row, you need to put a >nowiki /> tag at the beginning of the first parameter, because parser funcions trim the spaces and linebreaks. For example:
{{#if:{{{website|}}}| <nowiki />
! Website
{{!}} [{{{website|}}} Club home page]
{{!}}-
}}
--Ciencia Al Poder (talk) -WikiDex 14:53, 15 May 2009 (UTC)
Cool. That is a much nicer way to deal with the space stripping feature than what I have been doing. Thanks.-~ Phlox 20:53, 15 May 2009 (UTC)

Ok I did that but I am still getting problems, if I use that code I get this code on top of the box

<tr><td class="toccolours" style="padding: 0; background: #ffffff; text-align: center;" colspan="2"> 

And this one below it

</td></tr>

With the kits spread across the page, I didn’t create the code all I did was try and get it working but this part I have no clue on how to fix it.--TheWho87 00:44, 16 May 2009 (UTC)

I think the problem is Template:Football kit, which uses wikitables, and the pipecharacter is causing troubles inside the {{#if: }} of the Template:Infobox Football club. Why don't you use this template alone instead of transcluding it inside anoter template? --Ciencia Al Poder (talk) -WikiDex 10:19, 16 May 2009 (UTC)
I do agree with "Ciencia al Poder" the problem looks more related with the template you are transcluding using the {{#if...}} as if you want to use the template inside other templates you have to A) avoid using pipelines unless they are on links or other parsers. B)transform all non parse pipelines into the pipeline template trick {{!}}. C) transform the table from wiki table to HTML table, thats what wikipedia has many templates tables on HTML to avoid transclusion issues --Cizagna (Talk) Dofus » 20:29, 16 May 2009 (UTC)
First off as I say I just got to the place and I’m cleaning up what’s there which so far is just pages taken from wikipeda, my next problem is I’m only really good at basic levels of things like this, I can set a basic template for things like this but what I tend to do it take a code from another wiki and modify it to what I need so coding something like that I wouldn’t know where too start and I also wouldn’t know where to start to get the whole colour codes and such to work. Thanks anyway I guess for now I’ll just have to do with not having the feature in there, I think I know a way to get around it for now anyway thanks.--TheWho87 23:57, 16 May 2009 (UTC)