Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-06-27 08:10:51

jauhari
Member
Registered: 2007-05-24
Posts: 97
Website

Custom Output on search_input

I try to make custom output on

<txp:search_input button="Search" size="15" />

And when I tested on my browser become like this

<form action="http://plaza.txp/" method="get"><p>Search<br /><input type="text" name="q" value="" size="15" /><input type="submit" value="Search" /></p></form>

I want make the result like this

<form action="http://plaza.txp/" method="get"><input type="text" name="q" value="" size="15" /><input type="submit" value="Search" /></form>

How to do that?

Please give me advice. and thanks

Jauhari

Offline

#2 2007-06-27 08:21:09

jauhari
Member
Registered: 2007-05-24
Posts: 97
Website

Re: Custom Output on search_input

I was fix it with this code
<txp:search_input wraptag="" label="" button="go" size="15" />

but how to make my Button below my text input form? and how to add class or ID on my text input form?

Thanks

Offline

#3 2007-06-27 09:11:20

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,091
Website GitHub Mastodon Twitter

Re: Custom Output on search_input

Although using txp tags makes migration easier there is nothing that stops you using the html from the tag directly on your template

<form action="http://plaza.txp/" method="get" id="yourid" class="yourclass"><input type="text" name="q" value="" size="15" /><br /><input type="submit" value="Search" /></form>


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#4 2007-06-27 10:44:57

jauhari
Member
Registered: 2007-05-24
Posts: 97
Website

Re: Custom Output on search_input

Can you tell me more detail? what it mean, using txp tags?

Offline

#5 2007-06-27 12:49:23

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,091
Website GitHub Mastodon Twitter

Re: Custom Output on search_input

This might end up into a long discussion so I will focus in your question for this thread.
Basically if you use <txp:search_input button="Search" size="15" /> the search box which will be produced takes the url from the database… so in your case it adds http://plaza.txp/ which is the url you have in Admin>Preferences>Site URL

So… when/if you migrate your site to a new url all you need to do is change that as well as some of the paths in the Advanced preferences and the config.php and your site will be up and running in no time. If you go without the txp tags – say for the searchbox above- you will have another little thing to change.

Last edited by colak (2007-06-27 12:50:05)


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#6 2007-06-28 07:31:02

jauhari
Member
Registered: 2007-05-24
Posts: 97
Website

Re: Custom Output on search_input

I was try with this code

<form action="http://plaza.txp/" method="get" id="yourid" class="yourclass"><input type="text" name="q" value="" size="15" /><br /><input type="submit" value="Search" /></form>

But when I try to search and display the result. On my input form value not appear anymore.
I want my form value appear again on my input form. How to do this?

Please…

Last edited by jauhari (2007-06-28 07:57:53)

Offline

#7 2007-06-28 08:27:06

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,091
Website GitHub Mastodon Twitter

Re: Custom Output on search_input

do search results appear with the standard txp:search_input button="Search" size="15" />?


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#8 2007-06-28 18:08:57

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

Re: Custom Output on search_input

<form id="yourid" class="yourclass" method="get" action="<txp:site_url />">
	<input type="text" name="q" value="<txp:page_url type="q" />" size="15" /><br />
		<input type="submit" value="Search" />
</form>

Offline

#9 2007-07-02 04:39:15

jauhari
Member
Registered: 2007-05-24
Posts: 97
Website

Re: Custom Output on search_input

Running Good, but the current value doesn’t display on my input form again. How to make current value also display on my input form?

Offline

#10 2007-07-02 10:56:39

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

Re: Custom Output on search_input

What is it you’re expecting it to do?

Offline

#11 2008-02-06 14:28:01

ABDC
Member
From: the Netherlands
Registered: 2006-08-14
Posts: 17
Website

Re: Custom Output on search_input

For anybody else trying to figure this out: Just copying the code that Textpattern generates doesn’t seem to work. You should include a hidden INPUT with name “s” to indicate the section you are pointing to. As explained here: http://justinfrench.com/index.php?id=15

Offline

Board footer

Powered by FluxBB