Using template with paramaters as an introtemplate


Short version: It seems like I can't use templates with paramaters in the | introtemplate={{template|param}}. Is this correct? Is there a workaround?

Long version:

I'm trying to insert a template with paramaters as the introtemplate option. I would like to create a section heading if there are more than zero results returned by the ask query, and not create a section heading if zero results are returned. Here is my code:

{{#ask: [[Property1::Value1]] [[Category:Category1]] | introtemplate={{createHeading|Value1}} | link=none | limit=100 | format=list | sep=  | template=template1 | userparam=120px }}

The createheading template is as follows:


The output is as follows:


The paramater is correctly passed to the template, but the {{ and }} still remain.

Omitting the braces in the line | introtemplate={{createHeading|Value1}} breaks the statement. Omitting the braces and the paramater works perfectly fine if the template takes no arguments. Is there any way to do this, or any workaround? I am on version 1.21.11.


18:09, 20 August 2014

The introtemplate parameter can only take the name of the template to be inserted. So if the template is called "createheading" you can only do |introtemplate=createheading. I am surprised that you even got that far with your output.

09:40, 27 August 2014