• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Lack of interest Search bar - add variable to disable elements

cclaerhout

Well-known member
#1
It would be convenient to wrap some elements of the search bar between conditionals to enable/disable them.
Demo:
TMC.png
Template mod:
Template: search_bar
Search:
Code:
#([ \t]+)(<dl[^>]+>[\s]+<dt>.*searchBar_users[\s\S]+?</dl>)[\s]+?(<dl[^>]+>[\s]+<dt>.*searchBar_date[\s\S]+?</dl>)#i
Replace:
Code:
$1<xen:if is="!{$disableSearchBar.byUser}">
$1$2
$1</xen:if>

$1<xen:if is="!{$disableSearchBar.byDate}">
$1$3
$1</xen:if>
To use in template:
HTML:
<xen:container var="$disableSearchBar.byDate">1</xen:container>
<xen:container var="$disableSearchBar.byUser">1</xen:container>
Possible result:
result.png