Use this plugin to search weblog entry titles, custom fields, category names, category descriptions and category custom fields.
Search parameter syntax is identical to the weblog search parameter.
In addition to entry custom fields you can search entry titles, category names, category descriptions and category custom fields. When searching categories references to category fields should be prefixed with ‘cat_’.
For example:
search:cat_name=“keyword”
search:cat_description=“keyword”
search:cat_custom_field=“keyword”
Returns a delimited list of entry ids.
Parameters
————————
search:[field] = (optional) Field can be title, cat_name, cat_description, [custom_field_name], cat_[custom_field_name].
weblog = (optional) Single weblog name to search. Default is * (searches all weblogs).
operator = (optional) ‘AND’ or ‘OR’. Operator for joining search field WHERE conditions. Default is ‘OR’.
delimiter = (optional) Delimiter for returned entry id string. Default is pipe |.
placeholder = (optional) Single variable placeholder to replace with search results output. Default is search_results (use as {search_results}).
dynamic_parameters = (optional) Eg: “title|custom_field”. Allow specific search parameters to set via $_POST (form fields should have same name as the fields you wish to search).
This plugin is best used as a tag pair wrapping {exp:weblog:entries}.
Example
——————
{exp:search_fields search:title="keyword" search:custom_field="keyword" search:cat_name="keyword" operator="OR" weblog="my_weblog" parse="inward"}
{exp:weblog:entries entry_id="{search_results}" dynamic="off"}
<a href="{page_url}">{title}</a>
{/exp:weblog:entries}
{/exp:search_fields}
