Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2008-03-24 23:48:08

dreamer
Member
Registered: 2007-06-08
Posts: 242

How to stylize search bar

I want to stylize and position the search bar but I’m not sure how to do this because I don’t know what its selector is? I looked up the properties that belong to creating the search bar <txp:search_input />, but no help.

Offline

#2 2008-03-25 00:25:06

redbot
Plugin Author
Registered: 2006-02-14
Posts: 1,410

Re: How to stylize search bar

dreamer,
that’s what says textbook for the <txp:search_input /> tag:

bq. “Textpattern, as of this writing, will use a user defined form named search_results, or an internally defined default form if no search result form is defined by this name by the user.”

so you only have to create a form called “search_imput”, in which you can use any id or class you want.
If you’re unsure about the code to put in the form just examine the html source of a page using the “search_input” tag without the “form” attribute, then copy it in your “search_imput” form and add all the selectors you like.

Last edited by redbot (2008-03-25 00:48:49)

Offline

#3 2008-03-25 00:42:54

dreamer
Member
Registered: 2007-06-08
Posts: 242

Re: How to stylize search bar

redbot- I’m not sure if I completely understand. Where would I put the id or class around the txp tag? Can you give me an example? Here is what the tag looks like;

<txp:search_input size="25" label="" button="search site" />

I was unaware that I could take the html version and put that in the form. But I’d like to use the above as an example before messing with the 2nd option. This is how the source code looked like;

<form method="get" action="http://www.domain.com/">
<p><input type="text" name="q" value="" size="25" /><input type="submit" value="search site" /></p>
</form>

Offline

#4 2008-03-25 00:53:51

redbot
Plugin Author
Registered: 2006-02-14
Posts: 1,410

Re: How to stylize search bar

Sorry dreamer,
I made a mess and I’ve corrected my first post.
You have to use the tag this way:

<txp:search_input size="25" label="" button="search site" form="search_input" />

then create a misc form called “search_input” like this:

<form id="myform" method="get" action="http://www.domain.com/">
<p><input type="text" name="q" value="" size="25" /><input type="submit" value="search site" /></p>
</form>

notice the id attribute.

Last edited by redbot (2008-03-25 01:00:11)

Offline

#5 2008-03-25 01:45:21

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: How to stylize search bar

The form attribute is rather redundant. It’s far simpler to use output_form instead.

Offline

Board footer

Powered by FluxBB