Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-01-23 03:45:58

shifter
New Member
From: Australia
Registered: 2006-01-20
Posts: 8

displaying search results in a different section

I have a made a static page (in its own section) for doing searches. however the results show up using the homepage. i’m wondering how i can make the search results show up using the same page that you initiate the search from instead of the homepage.


What is and what should never be

Offline

#2 2006-01-23 03:59:40

jdykast
Member
From: Tennessee
Registered: 2004-12-30
Posts: 119
Website

Re: displaying search results in a different section

I’ve found this article to be helpful: JustinFrench.com: A Better Textpattern Search

Offline

#3 2006-01-23 04:33:58

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

Re: displaying search results in a different section

I think the trick here is to add your section to the “form” tag:-

<code><form action=”<txp:site_url />sectionName/” method=“get”></code>


Stuart

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

#4 2006-01-23 05:04:01

zem
Developer Emeritus
From: Melbourne, Australia
Registered: 2004-04-08
Posts: 2,579

Re: displaying search results in a different section

Use <txp:search_input section="search" />. The manual was incorrect about this, I fixed it up.


Alex

Offline

#5 2006-01-23 22:26:51

shifter
New Member
From: Australia
Registered: 2006-01-20
Posts: 8

Re: displaying search results in a different section

> zem wrote:

> Use <txp:search_input section="search" />. The manual was incorrect about this, I fixed it up.

I see. Didn’t it say that using the ‘section=’ attribute would make it search ONLY in that section?

well, i got it to work by visiting the link that jdykast gave and using some of the code there. but thanks to all of you for your replies.

To anyone else that reads this thread, try zem’s code, coz it looks a crapload easier.

Thanks folks :)


What is and what should never be

Offline

#6 2006-02-02 15:31:38

omnivore
New Member
From: Toronto, ON
Registered: 2004-10-01
Posts: 3
Website

Re: displaying search results in a different section

> zem wrote:

> Use <txp:search_input section="search" />. The manual was incorrect about this, I fixed it up.

Not sure why, but this does not seem to work as shown. My txp tag is:

<blockquote><code><txp:search_input label=“Search Lula” section=“search” button=“Search” size=“15” />
</code></blockquote>

and when the xhtml is generated it looks like this:

<blockquote><code><form action=“http://powerbook-2.local/index.php?s=search” method=“get”><p>Search Lula<br /><input type=“text” name=“q” value=“something” size=“15” /><input type=“submit” value=“Search” /></p></form></code></blockquote>

but when the button is clicked, the url is

<blockquote>http://powerbook-2.local/index.php?q=search+string</blockquote>

and the default page is returned. What happened to the ‘s=search+string’ in the url? Without it, I can see why it doesn’t get the section’s page, but where did it go? I’m using messy urls as a neccessity on this dev server, if that matters…

Offline

#7 2006-02-02 16:24:22

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: displaying search results in a different section

Hi all

isnt the following link the answer to the question of the thread title?

Using Search in Textpattern RC3

OK, it has been written for RC3 but I think it is still the method in 4.0.3.


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#8 2006-02-10 22:49:56

-rr-
Member
Registered: 2005-09-11
Posts: 73

Re: displaying search results in a different section

Can’t make this work txp:search_input section=“search” /> for me either. I get default page also.

Offline

Board footer

Powered by FluxBB