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

Having trouble installing Oxygen? Got a bug to report? Post it all here.
galanohan
Posts: 115
Joined: Mon Jul 10, 2023 11:49 am

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

Post 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
(1.35 KiB) Downloaded 45 times


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

Thank you!
alin
Site Admin
Posts: 268
Joined: Thu Dec 24, 2009 11:21 am

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

Post by alin »

Hello,

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

Regards,
Alin
Alin Balasa
Software Developer
<oXygen/> XML Editor
http://www.oxygenxml.com
galanohan
Posts: 115
Joined: Mon Jul 10, 2023 11:49 am

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

Post by galanohan »

thanks, that works well!
Post Reply