Updating the Global Search Block
The global search block allows end users to search tables that have been added to the End User Interface (EUI). You can configure the global search block by editing records in the EUI Templates table so that different or additional tables are searchable.
This article describes how you can manually edit the necessary code in each record to make additional tables searchable. However, it's typically easier to automatically generate the code, especially if you're adding an entirely new table to the EUI. For more information on how to automatically generate the code, see Working with Tables.
Prerequisites
Before making changes to the EUI, we recommend that you have a basic understanding of the following topics:
- HTML
- CSS
- Macros, methods, and conditionals, as they're used in the EUI
For more information on HTML and CSS, visit W3 Schools.
Adding a Table
Tables can be added to the global search block by editing two records in the EUI Templates table. The home-multiple-search.htm
record controls the tables that are displayed on the global search block, and the multiple-search-result.html
record configures the search result page for each table. Both records must be configured correctly to search tables from the global search block.
Before you start, go to the setup wizard for the table you want to add and note the following information:
- The plural table label
- The logical table name
Editing home-multiple-search.htm
This template controls the tables that are displayed on the global search block.
- Navigate to the EUI Templates table.
- Open
translation.properties
and scroll until you reach thehome.search
properties. Immediately following eachhome.search
property is a unique value associated with each EUI table, such asinc
,pr
, andcr
. - Write down the value associated with the table you want to add, and then close the
translation.properties
record. Edit
home-multiple-search.htm
and scroll to the first instance of this code.#if (($ewText.get("show.service.requests")=="yes")&&($ewPermission.table("helpdesk_case","view_own"))) <input name="tables" type="checkbox" onclick="selectSearch(this)" value="sr" id="sr"> <label for="sr">$ewText.get("home.search.sr")</label> <br> #end
Copy the entire code from
#if
to#end
and paste it directly below#end
.Replace the plural table label following
show.
on the first line with the new plural table label, formatted asshow.table.label
. For example, if adding the Change Request table, it should readshow.change.requests
.Replace
helpdesk_case
on the first line with the new logical table name, such aschange_request
.- On the second line, replace all instances of
sr
with the unique value you wrote down in Step 3. Ensure your code is free from errors. Here's the complete code we added for the Change Request table example:
#if (($ewText.get("show.change.requests")=="yes")&&($ewPermission.table("change_request","view_own"))) <input name="tables" type="checkbox" onclick="selectSearch(this)" value="cr" id="cr"> <label for="cr">$ewText.get("home.search.cr")</label> <br> #end
Click Save.
Editing multiple-search-result.html
This template configures the search result page for each table.
In the EUI templates table, edit
multiple-search-result.html
and scroll to the first instance of this code.#if ($queryTables.contains('sr') ) <div class="main_frames"> #ew_table("helpdesk_case" "" $defaultsearch "" "showToolBar=false&showNavigation=true&showfastsearch=false&showSearchCriteria=false" "my_table01" "") </div> #end
Copy the entire code from
#if
to#end
and paste it directly below#end
.- Replace
sr
on the first line with the correct value from thetranslation.properties
record. - Replace
helpdesk_case
on the third line with the new logical table name. Continue scrolling to find the first instance of this code. Note that the
my_table
parameter must be unique and must match the name provided in the#ew_table
parameters for the same table.#if ($queryTables.contains('sr')) #ew_query("helpdesk_case" "my_table01" "queryId" "showToolBar=false&showNavigation=false&showfastsearch=false") #end
Copy the entire code from
#if
to#end
and paste it directly below#end
.- Replace
sr
on the first line with the value from Step 3. - Replace
helpdesk_case
on the second line with the logical table name from Step 4. - Ensure your code is free from errors, and click Save. Your table is now searchable in the global search block.
Note: If the table does not appear:- Ensure the end user group has the correct permissions to view the table.
- Ensure
show.(table.label)
in thetranslation.properties
record is set to Yes.
Removing a Table
Tables can be removed from the global search block by editing the home-multiple-search.htm
record on the EUI Templates table.
- Navigate to the EUI templates table.
Edit
home-multiple-search.htm
and scroll to the first instance of this code.#if (($ewText.get("show.service.requests")=="yes")&&($ewPermission.table("helpdesk_case","view_own"))) <input name="tables" type="checkbox" value="sr" id="sr"> <label for="sr">$ewText.get("home.search.sr")</label> <br> #end
Continue scrolling until you find a similar block of code with the logical table name of the table you want to remove. The logical table name is near the end of the first line—
helpdesk_case
in the above example. For other tables, the code will be formatted exactly as above but will contain values appropriate to that table.- On the first line, delete the
yes
value and click Save. The table is now removed from the global search block, but if you ever need to add it back, you can just addyes
back where it was.
Related articles