Forum:Transfering the value of a paramter to another one

Hi everyone, I wonder if we can transfer a value of a parameter to another one like this: If = 10 = then = 10 Arciusazrael 15:28, July 17, 2011 (UTC)


 * Try


 * Since parameter 2 would not be input by the user anymore, it would no longer be a parameter. For more info about parser functions see this page. — Sovq 18:32, July 17, 2011 (UTC)


 * Sorry, my question is totally misleading. What I'm trying to do is put in #ifexpr. But somehow #ifexpr and #expr don't work with  . So, I want to transfer the value of the editcount to another parameter, say, . And put  in #ifexpr.
 * P/S: I'm creating a ranking system for our wiki where when users reach certain number of edits, their ranks and images on their profile would automatically change to the ones of the next rank. I got everything else works, except for this final step, using #ifexpr to compare editcount with a range of number. Arciusazrael 23:42, July 17, 2011 (UTC)


 * You're thinking of something like, which can't be done with Wikitext.   doesn't work with   because of parsing order, which you can modify to an extent, but it may not be possible in this case.
 * Is there no work-around? Can I assign the editcount value to a JavaScript variable and give the value back to a wiki's parameter? I spent 14 hours working on this yesterday and it's so frustrating if I have to stop here :( Arciusazrael 23:58, July 17, 2011 (UTC)
 * No, wikitext is parsed by the server, and JS is executed by your browser. You may want to look for some documentation on parsing order.


 * I don't understand what your problem is but I'm not an expert in that field.
 * If you look at the top of this forum you will see Provide a link to the wiki you need help with in your post. ;) Or instead, you can create a page here with the content you are trying to make it work.
 * Meanwhile you can try to pass (without any spaces) to a template that does the work needed, even if it's just to return the first parameter .  01:27, July 18, 2011 (UTC)


 * Sorry, I'm stuck with my final exams so I couldn't reply. So, this is the template that I made: . I use #switch with #ifexpr function. So, basically, #ifexpr will compare the value of the editcount with a range of number of the first case. If the value of editcount fit in the range, that case becomes "rank" which is the same with the value that #switch is trying to compare to and the image for that case will by displayed. Sorry, if I'm not making it clear, I'm really bad at explaining stuff. Arciusazrael 16:33, July 19, 2011 (UTC)


 * OK...
 * So you have the new editor crap so I can't properly debug the problem.
 * The problem is that returns a number with the thousands separator (the comma) in there; that comma has to be removed before comparing to numbers (or used in any other arithmetic operation).
 * 0 should work but for some stupid reason mediawiki (the software powering wikia) has a bug somewhere and it doesn't work.
 * I made my attempt here: http://valkyria.wikia.com/wiki/Template:Sandbox/editcount and nothing works.


 * Some wikis have an extension that makes work but wikia doesn't.
 * There's nothing more for me to try, doesn't work. 19:53, July 19, 2011 (UTC)


 * One more thing, I didn't pay attention to the rest of your template but I saw that the switch is rank, it probably should be .  19:57, July 19, 2011 (UTC)


 * Special:Editcount won't work directly inside a parser function, because it gets parsed after the function. There was a similar thread w while ago and nobody was able to figure out a solution or workaround, sorry. — Sovq 20:05, July 19, 2011 (UTC)


 * Would it be possible to AJAX the value from another page? That'd be one heck of a work-around, but might be possible if it still not affected by load order. Rappy 23:23, July 19, 2011 (UTC)


 * It is, although it's not ideal as the template would be broken until the JS got a response back from the server.