Forum for discussing general topics related to Couch.
6 posts Page 1 of 1
Hi,

I'm using the search_form along with search.php. I would like to change the 'Search' text with a search icon e.g:
<i class="fas fa search"></i>, but can't see how to do this? I've attached a PNG to illustrate my meaning. The reason behind it, is that the placeholder text is 'Search...' and don't require it written twice.

Thanks in advance.

Attachments

Hi,

Tag <cms:search_form /> is just a quick way to output a form - you don't have to necessarily use it.
You can hand code your custom form in its place and things will work just the same - just make sure that the <input> where the search text is entered is named 's' e.g.
Code: Select all
<input type="text" name="s" id="s" />

Hope this helps.
Thanks KK,

I'm having trouble with the button. It won't activate the search?
Below is the code. You can probably see the problem sooner than I can lol.

Code: Select all
<li><input type="text" name="s" id="s" placeholder="Search..."></li>
     <li><button type="button" class="button" href="<cms:show k_site_link />search.php" /><i class="fas fa-search"></i></button></li>

Attachments

That is not the full code of the form so I don't think it is complete enough to debug.

My suggestion would be to first use <cms:search_form />, then do a view-source to take a look at the HTML outputted by that tag (it is a full <form>). Copy that HTML and tweak it to suit your need.

Hope this helps.
Thanks KK,
It works perfectly!
You are welcome :)
6 posts Page 1 of 1