I would like to create the tx_news searchform on every page. So I try it to put it into the Layout:
<div class="news-search-form">
<f:form object="{search}" name="search" pageUid="{settings.searchPid}">
<fieldset>
<f:form.textfield id="news-subject" property="subject" class="form-control"/>
<f:form.submit class="btn btn-default search-button"/>
</fieldset>
</f:form>
</div>
The problem is, that {search}
is not defined when there is no searchplugin on the site.
When there is a searchplugin {search}
looks like this:
Tx_News_Domain_Model_Dto_Search (prototype transient entity)
subject => NULL
fields => NULL
uid => NULL
_localizedUid => NULL
_languageUid => NULL
pid => NULL
Am I somehow able to create this directly in the layout or what would be the best way to have the searchform on every page?