I have the following pocketquery template that is derived from the "default form template" discussed here: https://help.scandio.de/documentation/display/PQDOC/Default+PocketQuery+Templates
My custom template is as follows:
<form method="get" class="aui pq-dynamic-parameter-form" action="">
## store GET parameters that are not PQ specific in hidden fields so they don't get lost
#foreach($entry in $req.getParameterMap().entrySet())
#if (!$entry.key.startsWith("pq_") && $PocketQuery.getValueFromMapEntry($entry))
<input type="hidden" name="$entry.key" value="$PocketQuery.getValueFromMapEntry($entry)" />
#end
#end
<button type="submit" class="pq-change-button aui-button aui-style aui-button-primary">Change</button>
#foreach($key in $queryParameters.keySet())
#set($reqKey = "pq_$key")
#set($s=$PocketQuery.getParameterFromRequestOrMacro($key, $req, $queryParameters))
<div>
<label for="$reqKey">$key</label>
<select class="text" type="text" id="$reqKey" name="$reqKey" value="$!req.getParameter($reqKey)" />
<option value="Option1" #if("Option1"=="$s") selected="selected"#end>Option1</option>
<option value="Option2" #if("Option2"=="$s") selected="selected"#end>Option2</option>
</select>
</div>
#end
</form>
$PocketQuery.template("default")
This works as expected - it creates a dropdown box with 2 options in it, and a "change" button that I can use to update the query results depending on the option chosen.
However, I have 2 parameters in the query: call them param1 and param2. Right now the dropdown list shows for both parameters. I only want the dropdown list to apply to param1. Param2 will always be set to the page name. How do I tweak the template above to achieve this?
Thanks for your help!