Forum:Changing templates

I have a template that uses a random number to decide what to display. Here I have four of these in a row, and despite the fact that each instance of the changing template is independent of the others, they always show the same image. They should work on their own - so why do they always display the same thing.

http://doctor-who-collectors.wikia.com/wiki/Template:Recent_releases- four in a row http://doctor-who-collectors.wikia.com/wiki/Template:Change - changing template

Any ideas on how to fix this?  Tardis1963   talk  10:55, October 11, 2012 (UTC)

Is anyone able to help?  Tardis1963   talk  10:33, October 13, 2012 (UTC)


 * The problem is because your random function is not random. What you want is this: mw:Extension:RandomSelection. This is already installed and available to you, use it instead. Lunarity 14:04, October 13, 2012 (UTC)


 * Additional note: RandomSelection extension is subject to caching. What happens when you use it is, the first time you visit a page, it'll randomly pick one of the options just like you want. On subsequent visits to that same page however, the page is cached already, so you will see that same option over and over again unless you clear the cache.


 * One neat little solution to this problem is described in the FAQs at Forum:Prevent page caching with forum tags. If you use that trick, it will prevent a wiki page from caching at all, which means when using RandomSelection on a non-cached page, you will always see a different random option get selected on every page load.