I have a EE site and I’m trying to use conditionals to create output specific to separate groups. I have a “search” snippet that has the following code.
<div id="search">
{exp:search:simple_form search_in="entries" no_result_page="search/no-results/" result_page="search/results/" show_expired="yes" show_future_entries="yes" channel="not spotlight|exceptional_service|ideas|promo_entry" status="not private"}
<div class="input-wrapper">
<input type="text" name="keywords" autocomplete="off" id="keywords" value="Begin Searching…" /></div>
<input type="submit" value="" class="submit" />
{/exp:search:simple_form}
</div>I’ve tried the following:
<div id="search">
{if username == "philecker"}
{exp:search:simple_form search_in="entries" no_result_page="search/no-results/" result_page="search/results/" show_expired="yes" show_future_entries="yes" channel="not spotlight|exceptional_service|ideas|promo_entry"}
{if:else}
{exp:search:simple_form search_in="entries" no_result_page="search/no-results/" result_page="search/results/" show_expired="yes" show_future_entries="yes" channel="not spotlight|exceptional_service|ideas|promo_entry" status="not private"}
{/if}
<div class="input-wrapper">
<input type="text" name="keywords" autocomplete="off" id="keywords" value="Begin Searching…" /></div>
<input type="submit" value="" class="submit" />
{/exp:search:simple_form}
</div>And
<div id="search">
{exp:search:simple_form search_in="entries" no_result_page="search/no-results/" result_page="search/results/" show_expired="yes" show_future_entries="yes" {if username == "philecker"}{if:else}status="not private"{/if} channel="not spotlight|exceptional_service|ideas|promo_entry"}
<div class="input-wrapper">
<input type="text" name="keywords" autocomplete="off" id="keywords" value="Begin Searching…" /></div>
<input type="submit" value="" class="submit" />
{/exp:search:simple_form}
</div>Both give me errors like below.
Parse error: syntax error, unexpected T_ENDIF in /var/www/html/teamnet/system/expressionengine/libraries/Functions.php(656) : eval()'d code on line 66I’m trying to get status=“not private” to display for one group and not another. Can I not use conditionals within simple search forms? Any help would be greatly appreciated.