1. 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

Discussion in 'Closed Suggestions' started by cclaerhout, Nov 3, 2014.

  1. cclaerhout

    cclaerhout Well-Known Member

    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
     

Share This Page