Page MenuHomePhabricator

Inline Query template use - Passing Static Arguments
Closed, DeclinedPublic

Description

Author: trueskew

Description:
I've got a couple areas of my wiki where I could use an inline query template like this:

  • {{{1}}} {{#if:{{{2}}} |
    • {{{2}}}: {{{3}}} }} {{#if:{{{4}}} |
    • {{{4}}}: {{{5}}} }} {{#if:{{{6}}} |
    • {{{6}}}: {{{7}}} }} etc.

I've got this great search engine and I'd like the user to pick what information they want listed. It would be easy to set up the inline query to pass only certain values to the template. What I'm missing is a way to pass a fixed string to a template through in inline query. To illustrate, my querey would be something like:

{{#ask: [[Category:BuildClassifier]]

mainlabel={{PAGENAME}}

{{#if: {{{BuildMaterialSelected|}}} |
{{

(send "Build Material")
?Has BuildMaterial=

}} }}
{{#if: {{{BuildLocationSelected|}}} |
{{

(send "Build Location")
?Has BuildLocation=

}} }}
{{#if: {{{BuildCostSelected|}}} |
{{

(send "Build Cost")
?Has BuildCost=

}} }}
format=template
template=VariableBuildList
}}

My alternative is to be less flexible with the output, or to create every possible permutation. My real pages have 7-10 parameters, so the latter won't work out too well.


Version: unspecified
Severity: enhancement

Details

Reference
bz24913

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 11:05 PM
bzimport set Reference to bz24913.

If I correctly understand what you want, define Template:! containing only |.

Then pass to {{#ask:}} template=VariableBuildList{{!}}1=Build Material.

There is also the userparam option (https://semantic-mediawiki.org/wiki/Help:Template_format#Usage_for_userparam) but it is of limited use.

Doesn't look like a bug.

Aklapper subscribed.

The Semantic MediaWiki developers requested in https://phabricator.wikimedia.org/T64114 to move their task tracking to https://github.com/SemanticMediaWiki/SemanticMediaWiki/issues and to close remaining tasks in Wikimedia Phabricator. If you still face the problem reported in this task in a supported version of SMW, please feel free to transfer your report to https://github.com/SemanticMediaWiki/SemanticMediaWiki/issues . We are sorry for the inconvenience.