Skip Navigation
Expand
Cannot query HTML tag attributes in Find or Global Find and Replace
Answer ID 11804   |   Last Review Date 01/21/2021

Why can't I use Global Find and Replace to change a CSS property?

Environment:

Oracle B2C Service sites using the Knowledge Advanced answer architecture

Issue:

An administrator is trying to use Global Find and Replace to change the formatting within some legacy articles. These answers have <div> elements as in the following code example, and the user wants to change 1000px to 3000px due to the availability of high resolution displays.

<div style="max-width: 1000px">
Bears are very scary.
</div>

Resolution:

There is not native functionality in Knowledge Advanced to find individual articles by the values of HTML tags, scripts, stylesheets, and the attributes of those source code elements. The indexing for the Find functionality only indexes the text that would be shown to a user in the editor or web browser.

In the article above, we can use Global Find and Replace to find Bears and change it to Murder hornets but the string 1000px will not be found. This is working as expected. To use the example of another application, in a word processor you might expect to use a find tool to reach the literal text "Helvetica" but not any arbitrary text that is underlined and in the Arial font.

As a best practice, styling should be handled within the Customer Portal (or whatever client application is displaying the knowledge base content). That way, individual articles do not have to be edited when updating the look and feel of your knowledge base.

Notes:

Attribute-level search must be enabled within the content type schema when using Find or Global Find and Replace. See the Documentation for Knowledge Advanced for the version you are using for information on content type configuration.