Custom Search Forms in UNA
Create custom search forms for any installed content module in UNA. In this example, we will add a new search form for "Persons".
Prerequisites
- Install the Developer module (if not already installed).
- Go to Studio > Developer > Forms > Search Forms.
- Select the module where you want to add a new search form (Persons in our case).
- Click "Add New Search".
Creating the Search Form
- In the popup, fill in the following fields:
- Name: Unique name of the search form (e.g., bx_persons_search_adv).
- Content Info object: The "source" for the searched info (Persons in our case).
- Module: Module where the search will be performed (Persons).
- Title: The language key for the caption of the search form (_bx_persons_search_adv).
- Optional fields "Class Name" and "Class File" are for advanced customization of the search form.
- Click "Save".
Adding Fields to the Search Form
- In the list of search forms, click on "0 fields" under the "Fields" column for the new form.
- Click "Reset" to import fields from the "Add Items" of the current module (e.g., "Add person").
- Each field has an "Edit" icon for editing field settings.
Placing the New Search Form on a Page
- Go to Developer > Pages > Persons area.
- Choose the page where you want to display the new search form.
- Click "Add blocks" and find the "Persons" module in the left column.
- In the right column, find the "Search form" and "Search results" blocks and check both.
- Click "Add to page".
- In the settings of the new "Search form" block, find the "Code" field and replace the line
'object' => 'bx_persons',
with'object' => 'bx_persons_search_adv',
. - Click "Save".
Your new search form will appear in the chosen place.
For a more descriptive tutorial from the community, visit: https://una.io/page/view-discussion?id=1461