Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-03-18 08:25:28

december76
Member
From: Malmö, Sweden
Registered: 2004-05-18
Posts: 45
Website

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

#2 2006-03-18 11:32:53

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

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

#3 2006-03-19 09:06:34

december76
Member
From: Malmö, Sweden
Registered: 2004-05-18
Posts: 45
Website

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

#4 2006-03-19 09:33:06

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

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

Board footer

Powered by FluxBB