Wikia

Lostpedia

Watchlist Recent changes

Cgmv123/TemplateCoding

< Cgmv123

After the Wikia move, several of our expensive templates suddenly stopped working after so many calls on a page. This is an attempt to raise the limit to where we hopefully will never run into any issues. Note: documentation coding has been removed for simplicity's sake. These changes, in theory, would allow Template:ep to be called an unlimited number of times and Template:crossref to be called ~350 times as opposed to the current limit of ~175. (With the present coding, #ifexist is called twice for episodes, with this new coding, it is only called once.)

Contents

Template:Ep Edit

Current CodeEdit


<includeonly>"{{#ifexist:Template:Ep/{{{1|}}}|{{#if:{{{bold|}}}|'''}}[[{{Template:Ep/{{{1|}}}|a }}|<span title=
"{{Template:Ep/{{{1|}}}}} (episode: {{{1|}}})">{{ Template:Ep/{{{1|}}} }}</span>]]{{#if:{{{bold|}}}|'''|{{{2|}}}}}}}"</includeonly>

Proposed IdeaEdit


<includeonly>"{{#if:{{{bold|}}}|'''}}{{if:{{{link|}}}||[[}}{{Template:Ep/{{{1|}}}|a }}|<span title="{{Template:Ep/{{{1|}}}}} 
(episode: {{{1|}}})">{{ Template:Ep/{{{1|}}} }}</span>{{if:{{{link|}}}||]]}}{{#if:{{{bold|}}}|'''|{{{2|}}}}}}}"</includeonly>

ChangesEdit

Removed #ifexist function at beginning, if you're calling this template, you know which episode you're going to call. Also added link parameter, so using link=0 does not generate a link.

Template:CrossrefEdit

Current CodeEdit


<includeonly><small>{{#if:{{{1|}}}|({{Crossref link|{{{1}}}}})}}{{
#if:{{{2|}}}|  ({{Crossref link|{{{2}}}}})}}{{
#if:{{{3|}}}|  ({{Crossref link|{{{3}}}}})}}</small></includeonly>

Proposed CodeEdit


<includeonly><small>({{Crossref link|{{{1}}}}}){{
#if:{{{2|}}}|  ({{Crossref link|{{{2}}}}})}}{{
#if:{{{3|}}}|  ({{Crossref link|{{{3}}}}})}}</small></includeonly>

ChangesEdit

Removed #if function at beginning, because if you're calling the template, you want at least one crossref.

Template:Crossref linkEdit

Current CodeEdit


<includeonly>{{#ifexist:template:ep/{{{1}}}
	|{{ep|{{{1}}}}} 
	|{{#ifexist:template:mag/{{{1}}}
		|{{mag|{{{1}}}}}		
		|{{#ifexist:{{{1}}}
			|{{#switch:{{{1|}}}|promo=[[Still photography|promotional still]]|#default=[[{{{1}}}]]}}
			|[[wikipedia:{{{1}}}|{{{1}}}]] 
		}}	
	}}
}}</includeonly>

Proposed codeEdit


<includeonly>{{#ifexist:template:ep/{{{1}}}
	|{{ep|{{{1}}}}} 
	|{{#ifexist:template:mag/{{{1}}}
		|{{mag|{{{1}}}}}		
		|{{#switch:{{{1|}}}|promo=[[Still photography|promotional still]]|#default=[[{{{1}}}]]}}
			|[[{{{1}}}]] 
		}}	
	}}
}}</includeonly>

ChangesEdit

Made default to Lostpedia articles. Wikipedia articles could still be referenced by {{crossref|wikipedia:ARTICLENAME}} In theory if we overrun our count, it will still display XxXX which would link to the appropriate article.

Pages on Lostpedia

7,272pages on
this wiki

Latest Photos

Add a Photo
24,232photos on this wiki
See more >

Recent Wiki Activity

See more >

Recent Questions

Around Wikia's network

Random Wiki