Searchable but hidden text in HTMLJanuary 14, 2008
If you have text/content that you want people such as reviewers and developers to find via a search, but you don’t want that text visible to everyone else, then consider setting up a ‘hidden’ paragraph or character style. The content you apply that style to will be invisible to the general reader but those who know about it can search for it and view it.
For example, technical documentation I wrote for a client was very much in the beta stage and the internal staff needed to be able to see which ‘Use Cases’ each topic applied to. However, external clients didn’t need this information—in fact, it was meaningless to them. The internal staff needed the ability to search on a particular use case number in the online help and get those topics listed in the search results.
What I did to meet both needs was:
- Create a paragraph style called “Use case” that had white text on a white background in the CSS, and was styled in red for the view that the author sees in Author-it.
- Add a new line with “Use Case: #” (where # represents the Use Case number) to the end of each topic related to a particular Use Case.
- Apply the “Use case” style to that last line.
In the HTML or CHM output these lines never showed but they were searchable. If a developer wanted to see all user documentation topics related to Use Case 68, they only had to do a search for 68. Or if they dragged their cursor over the last few lines of a topic they’d see the ‘hidden’ text for the Use Case that it related to.
The internal staff were told how to use this, but not the end users. It would only be by chance that an end user would ever come across the Use Case number.
You could do something similar using Author-it’s system variable for the object ID. Add it to the bottom of each topic (perhaps add it to your normal topic template so you don’t have to remember to add it each time), and style it with something that displays as ‘hidden’. Chances are only you and perhaps one or two others will EVER want to know the object ID. It’s still searchable, just not immediately viewable by end users.