I have a number of select fields, but after each select the actionid for the subsequent fields changes and the search fails.
Here is an example of a custom search template:
Code: Select all
<div id="{$modulealias}_search" class="card bg-contrast-0 rounded-6 border-0 shadow">
<div class="card-body p-5">
{$formstart|replace:'method="post"':'method="get"'}
<div class="row">
<div class="col-12 form-group">
<label for="{$modulealias}searchinput">Search Terms: {$actionid}</label>
<input class="form-control" type="text" id="{$modulealias}searchinput" name="{$actionid}search" size="20" maxlength="50" value="" />
</div>
{foreach from=$fielddefs item=fielddef}
{if $fielddef->alias == 'category'}
<div class="col-12 form-group">
<label for="{$modulealias}category">Category: {$actionid}</label>
<select class="form-select" id="{$modulealias}category" name="{$actionid}search_{$fielddef->alias}">
<option value="" selected="selected">- None -</option>
{LISElldb action='category' template_category='categorySearch'}
</select>
</div>
{/if}
{if $fielddef->alias == 'project'}
<div class="col-12 form-group">
<label for="{$modulealias}project">Project: {$actionid}</label>
<select class="form-select" id="{$modulealias}project_lise_instance" name="{$actionid}search_{$fielddef->alias}">
<option value="" selected="selected">- None -</option>
{LISEProjects template_summary='projectSearch' orderby='custom_project_code|DESC'}
</select>
</div>
{/if}
{/foreach}
<div class="submit">
<input class="button button-large button-dark rounded m-0" name="submit" value="{$mod->ModLang('search')}" type="submit" />
</div>
</div>
{$formend}
</div>
</div>
I have also tried to use the default filter template, but there are all select fields without values.
Code: Select all
{LISElldb action='search' filter='status' summarypage='search-result' template_search='filter'}
Code: Select all
lisefd_Dropdown Object
(
[id:protected] => 2
[name:protected] => Status
[alias:protected] => status
[description:protected] =>
[type:protected] => Dropdown
[friendlytype:protected] => Dropdown
[value:protected] => LISEFielddefValue Object
(
[storage:ArrayObject:private] => Array
(
)
)
[originator:protected] => LISE
[active:protected] => 1
[disabled:protected] =>
[path:protected] => /var/www/domain.dk/public_html/app/lldb/modules/LISE/lib/fielddefs/Dropdown
[position:protected] => 4
[required:protected] => 0
[options:protected] => Array
(
[0] => Draft
Ready For Review
Validated
[options] => Draft
Ready For Review
Validated
)
[caller:protected] => LISElldb
[item_id:protected] => -1
[parent_array:protected] => LISEFielddefArray Object
(
[_parent_item:LISEFielddefArray:private] =>
[storage:ArrayObject:private] => Array
(
[2] => lisefd_Dropdown Object
*RECURSION*
)
)
[template:protected] => {$fielddef.name}: {$fielddef.value}
[view:protected] =>
[hastemplate:protected] => 1
[event_handler:protected] =>
[values] => Array
(
)
)