Board Thread:Support Requests - Getting Technical/@comment-761499-20140621213640

I've made a template which shows a table of various graphics depending on what files exist on my wiki (using ). These files have procedurally-generated names, and the template uses a parameter (a number) to help generate the names. The display of some images depends on the existence of other images (e.g. if 001.png exists, then show both 001.png and 001s.png, otherwise show neither).

The template displays the correct images just fine. My problem is a relatively minor one. All possible files that the template could make using its parameter are listed in the Wanted Pages list, even ones that aren't used (said files do not appear in the Wanted Images list, though). Taking the previous example, even if 001.png does NOT exist on my wiki, both it and 001s.png will still appear as wanted pages. They are shown to be wanted by the page that uses the template. It seems that  is evaluated and added to the page using the template even if that bit of code appears in an   clause that failed its argument, and yet it is not actually displayed in the page.

Is there a way to remedy this? Each page that uses the template could have about a dozen unshown image variants (which will never exist), and the template is being used on hundreds of pages, each of them showing different images. This will cause a lot of clutter in the Wanted Pages list, which I want to avoid. The same thing happens with category tags and regular #if clauses (and probably all other such parser functions), but that's not so much of an issue for me.

I'm using various versions of the code snippet below. The parameter will only ever be a positive integer.

Thanks. 