Page tree
Skip to end of metadata
Go to start of metadata

Updating the Global Search Block

The global search block on the main page can be configured to display different tables by default. The end user is able to search the records of the tables that are displayed.

Prerequisites

Before making changes to the EUI, we recommend that you have a basic understanding of the following topics:

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.

  1. Navigate to the EUI Templates table.
  2. Open translation.properties and scroll until you reach the home.search properties. Immediately following each home.search property is a unique value associated with each EUI table, such as inc, pr, and cr.
  3. Write down the value associated with the table you want to add, and then close the translation.properties record.
  4. 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
  5. Copy the entire code from #if to #end and paste it directly below #end.

  6. Replace the plural table label following show. on the first line with the new plural table label, formatted as show.table.label. For example, if adding the Change Request table, it should read show.change.requests.

  7. Replace helpdesk_case on the first line with the new logical table name, such as change_request.

  8. On the second line, replace all instances of sr with the unique value you wrote down in Step 3.
  9. Ensure your code is free from errorsHere'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
  10. Click Save.

Editing multiple-search-result.html

This template configures the search result page for each table.

  1. 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
  2. Copy the entire code from #if to #end and paste it directly below #end.

  3. Replace sr on the first line with the correct value from the translation.properties  record.
  4. Replace helpdesk_case on the third line with the new logical table name.
  5. 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
  6. Copy the entire code from #if to #end and paste it directly below #end.

  7. Replace sr on the first line with the value from Step 3.
  8. Replace helpdesk_case on the second line with the logical table name from Step 4.
  9. 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:
    1. Ensure the end user group has the correct permissions to view the table.
    2. Ensure show.(table.label) in the translation.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.

  1. Navigate to the EUI templates table.
  2. 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
  3. 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.

  4. 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 add yes back where it was.




  • No labels