Page 1 of 1

what's the proper method of customizing placeholder text in the search field?

Posted: Wed Aug 23, 2023 10:53 am
by galanohan
Since I want to tell users to split Chinese keywords with more than 3 words into several parts, for example, split 数据库操作 to 数据 库 操作, so I'm trying to add a custom prompt text in the search field of webhelp. My guess is to modify the placeholder text for the input element of class wh_search_textfield.

For example,

<div class=" wh_search_input "><form id="searchForm" method="get" role="search" action="search.html"><div><input type="search" placeholder="为什么啊 为什么 " class="wh_search_textfield" id="textToSearch" name="searchQuery" aria-label="搜索查询" required="required"><button type="submit" class="wh_search_button" aria-label="搜索"><span class="search_input_text">搜索</span></button></div></form></div>

Note that I used the search-in-header template (https://github.com/oxygenxml/oxygen-pub ... -in-header), so I added the preceding div scripts to the move-search-in-header.xsl. see attached.
move-search-in-header.zip


But insert the div scripts to here doesn't work at all:
image.png
Because in the output I have the following layout:
image.png
So which file should I modify to customize the placeholder text in a search field?

Thank you!

Re: what's the proper method of customizing placeholder text in the search field?

Posted: Mon Aug 28, 2023 9:12 am
by alin
Hello,

Please check the Modifying the Existing Strings procedure in our User Guide.

Regards,
Alin

Re: what's the proper method of customizing placeholder text in the search field?

Posted: Thu Aug 31, 2023 12:10 pm
by galanohan
thanks, that works well!