Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
Add ID to search form
Hello!
How do I easily hack ‘taghandler.php’ to add an id to the <txp:search_input> form?
I would much appreciate an answer.
/Joakim
Offline
Re: Add ID to search form
There is no need to hack anything. You can add an “id” to the form tag like so:-
<code>
<form id=“searchform” action=”<txp:site_url />search/” method=“get”>
<div>
<input type=“text” name=“q” value=”“ size=“15” /><input type=“submit” value=“Go” />
</div>
</form></code>
<br />
That includes my own styling divs etc. and I use a separate section for the search results so you will have to fit it to your own needs.
Stuart
In a Time of Universal Deceit
Telling the Truth is Revolutionary.
Offline
Re: Add ID to search form
Great, thank you! I found that you even can input the value of you last search into the search form by simply outputting the global variable $GLOBALS[‘q’] into the value=”“ attribute.
/Joakim
Offline
Re: Add ID to search form
I’m not sure where you are going with that. Did you mean something like <code><txp:search_result_count /> for “<txp:q />”</code> as a title for the search results?
Stuart
In a Time of Universal Deceit
Telling the Truth is Revolutionary.
Offline
Pages: 1