Difference between revisions of "Template talk:Hgame"

From Hgames Wiki
Jump to: navigation, search
(WTF: new section)
 
(WTF)
Line 15: Line 15:
 
* if no, it prints the value of game
 
* if no, it prints the value of game
 
It prints a string equal to game in any case. I'm going to poke around the template a bit to get a better idea what's going on. - [[User:Loliturma|Loliturma]] ([[User talk:Loliturma|talk]]) 09:11, 24 March 2014 (UTC)
 
It prints a string equal to game in any case. I'm going to poke around the template a bit to get a better idea what's going on. - [[User:Loliturma|Loliturma]] ([[User talk:Loliturma|talk]]) 09:11, 24 March 2014 (UTC)
 +
: The reason for that is to enable the template to guess it's game in a subpaged structure, so the ''game='' parameter is no longer needed when using subpages - without breaking compatibility with the "classic" page structure of older games. The target is to reduce the number of parameters to the template and make the template more "smart".  --[[User:Hmoeller|<span style="font:bold 12px Times New Roman;">hmoeller</span>]] <sup style="font: normal 10px Times New Roman"> [ [[User talk:Hmoeller|Talk]] - [[Special:Contributions/Hmoeller|Contribs]] ]</sup> 10:33, 24 March 2014 (UTC)

Revision as of 11:33, 24 March 2014

WTF

I peeked at the template and noticed multiple duplications of this code: {{#ifeq: {{{game|{{#titleparts: {{FULLPAGENAME}}|1}}}}}|{{#titleparts: {{FULLPAGENAME}}|1}}|{{#titleparts: {{FULLPAGENAME}}|1}}|{{{game}}}}}

The same with better readability

{{#ifeq: {{{game|{{#titleparts: {{FULLPAGENAME}}|1}}}}}
       | {{#titleparts: {{FULLPAGENAME}}|1}}
       | {{#titleparts: {{FULLPAGENAME}}|1}}
       | {{{game}}}
}}

So, it checks if the value of game is equal to the first part of fullpagename.

  • if yes, it prints the first part of fullpagename
  • if no, it prints the value of game

It prints a string equal to game in any case. I'm going to poke around the template a bit to get a better idea what's going on. - Loliturma (talk) 09:11, 24 March 2014 (UTC)

The reason for that is to enable the template to guess it's game in a subpaged structure, so the game= parameter is no longer needed when using subpages - without breaking compatibility with the "classic" page structure of older games. The target is to reduce the number of parameters to the template and make the template more "smart". --hmoeller [ Talk - Contribs ] 10:33, 24 March 2014 (UTC)