Topic on Extension talk:Variables

Calling #var on a different template?

2
Summary by MGChecker

This is possible.

119.92.13.245 (talkcontribs)

I'm pretty new to this so it's still confusing to me.

So I have template1 and template 2. Template 1 does usd=12345, template 2 on the other hand has prize=5000. Is it possible to do match between these two tho they're on two different templates? I was trying the following but can't make it work and I'm stuck.

{{#vardefine:{{{result}}}|{{#expr:{{#var:prize}}*{{#var:usd}}}}}}

Dinoguy1000 (talkcontribs)

If the current template designs allow for it, I would recommend explicitly passing the needed values as template parameters, instead of relying on Variables. Not only does this bypass the problems you're facing now, but it also avoids a whole host of maintenance and code comprehension issues into the future.