Difference between revisions of "Template talk:Body data"

From Kerbal Space Program Wiki
Jump to: navigation, search
(explosions)
(explosions)
Line 2: Line 2:
 
hi! i'm new to this wiki but i am not new to wikis. i think the system used for this template — which involves tons of subpages and #switches — is a bit unnecessarily overcomplicated. it also has to be updated every time a new datum is entered (rather than just editing the [Body]/Data infobox). i've made a replacement using the #explode string function, which can be viewed in [[User:Apollo/sandbox|my sandbox]]. here's the content:  
 
hi! i'm new to this wiki but i am not new to wikis. i think the system used for this template — which involves tons of subpages and #switches — is a bit unnecessarily overcomplicated. it also has to be updated every time a new datum is entered (rather than just editing the [Body]/Data infobox). i've made a replacement using the #explode string function, which can be viewed in [[User:Apollo/sandbox|my sandbox]]. here's the content:  
 
<pre>
 
<pre>
{{#explode:{{#explode:{{msgnw::{{{1|}}}/Data}}|{{{2|}}}&#61;|1}}|&#124;|0}}
+
{{#explode:{{#explode:{{msgnw::{{{1|}}}/Data}}|{{{2|}}}&amp;#61;|1}}|&amp;#124;|0}}
 
</pre>
 
</pre>
 
transclusion works like this:
 
transclusion works like this:
Line 19: Line 19:
 
|…
 
|…
 
}}|
 
}}|
{{#explode:{{#explode:{{msgnw::{{{1|}}}/Data}}|{{{2|}}}&#61;|1}}|&#124;|0}}
+
{{#explode:{{#explode:{{msgnw::{{{1|}}}/Data}}|{{{2|}}}&amp;#61;|1}}|&amp;#124;|0}}
 
}}</pre>
 
}}</pre>
 
:— [[User:XZise|xZise]] <small>&#91;[[User talk:XZise|talk]]&#93;</small> 04:25, 21 August 2013 (CDT)
 
:— [[User:XZise|xZise]] <small>&#91;[[User talk:XZise|talk]]&#93;</small> 04:25, 21 August 2013 (CDT)
 +
:I changed the parameters so that they don't get parsed here to see how your code works. I was wondering why the inner explode only had 3 parameters and the outer four, until I noticed that one of the pipes is in fact a HTML entity. — [[User:XZise|xZise]] <small>&#91;[[User talk:XZise|talk]]&#93;</small> 10:52, 21 August 2013 (CDT)

Revision as of 15:52, 21 August 2013

explosions

hi! i'm new to this wiki but i am not new to wikis. i think the system used for this template — which involves tons of subpages and #switches — is a bit unnecessarily overcomplicated. it also has to be updated every time a new datum is entered (rather than just editing the [Body]/Data infobox). i've made a replacement using the #explode string function, which can be viewed in my sandbox. here's the content:

{{#explode:{{#explode:{{msgnw::{{{1|}}}/Data}}|{{{2|}}}&#61;|1}}|&#124;|0}}

transclusion works like this:

{{:User:Apollo/sandbox|Moho|orbinc}}
{{:User:Apollo/sandbox|Eve|soi}}

yields:

7
Error: String exceeds 1,000 character limit.

etc. feel free to test it out with any other celestial body/parameter. i just wanted to ask whether this would be preferable before going ahead and implementing it in place of this template. especially since i'm new around here! thanks ~ Apollo [talk] 00:11, 21 August 2013 (CDT)

This looks interesting! Absolutely worth considering. Of course changing this system takes a bit of work, as first the /Data pages should be updated, then this template and then the {{Infobox/Body}} (but that is optional). Although what would be your plan about the math type templates? — xZise [talk] 04:20, 21 August 2013 (CDT)
And also the test values (name == Planetbox) need to handled. I wouldn't use Planetbox/Data as a page, but maybe add an if and switch?
{{#ifeq: {{{1}}}|Planetbox|{{#switch: {{{2}}}
|radius=10000
|…
}}|
{{#explode:{{#explode:{{msgnw::{{{1|}}}/Data}}|{{{2|}}}&#61;|1}}|&#124;|0}}
}}
xZise [talk] 04:25, 21 August 2013 (CDT)
I changed the parameters so that they don't get parsed here to see how your code works. I was wondering why the inner explode only had 3 parameters and the outer four, until I noticed that one of the pipes is in fact a HTML entity. — xZise [talk] 10:52, 21 August 2013 (CDT)