Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-02-04 17:13:21

mwr
Member
From: Canada
Registered: 2006-01-31
Posts: 167
Website

search results woes

I keep getting the same, wrong result when doing a search. I’m using the txp:article_custom tag, in which case the FAQ suggests using a separate section and template to display the search results.

1. Created search_results template, making sure it contains txp:article

2. Created Results section using search_results as the page and turning all the options to No.

3. Placed section=“Results” in the search_input tag.

Not only do I continue to get the same, wrong result, but it insists on putting it on the front page instead of the results page I created.

Please help!

P.S. This is my first attempt at using Textpattern, or any other CMS for that matter.


Mark

Offline

#2 2006-02-04 17:30:09

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: search results woes

I think “section=“Results” means that only that section will be searched.

I’m using something like this to display the search results in it’s own section.

Offline

#3 2006-02-04 18:04:27

mwr
Member
From: Canada
Registered: 2006-01-31
Posts: 167
Website

Re: search results woes

The manual gives the following as an attribute of txp:search_input:
section=“section name”
Use the specified section as the destination page that will display the search results. Default behaviour is to use the front page.

Anyhoo, I’d like to give the form you suggested a try. What should I place in the area for form action?


Mark

Offline

#4 2006-02-04 18:33:23

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: search results woes

In your case it should be action=”/results/”.

This is what my form looks like:
<code>
<form id=“searchform” name=“searchform” action=”/zoek/” method=“get”><label>Zoeken<input id=“search” name=“q” value=“typ zoekwoord + enter” size=“20” onblur=“if (this.value '') {this.value = 'typ zoekwoord + enter';}" onfocus="if (this.value ‘typ zoekwoord + enter’) {this.value = ‘’;}” /></label></form>
</code>
Don’t know if it’s the best way to do it, but it works.

Last edited by doggiez (2006-02-04 18:33:47)

Offline

#5 2006-02-04 18:44:48

mwr
Member
From: Canada
Registered: 2006-01-31
Posts: 167
Website

Re: search results woes

I copied your code and replaced /zoek/ with /results/

Unfortunately my result is: The requested URL /results/ was not found on this server.

Last edited by mwr (2006-02-04 18:51:07)


Mark

Offline

#6 2006-02-04 21:10:08

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: search results woes

Maybe you are not using clean urls? Then this article might help.

Offline

#7 2006-02-04 22:20:53

mwr
Member
From: Canada
Registered: 2006-01-31
Posts: 167
Website

Re: search results woes

Well, I found a solution — redesigning the page so that it uses txp:article instead of txp:article_custom. I’ve since read that txp:article_custom is actually something to be avoided except in special cases. In any case, thanks very much for your attempts at helping me.


Mark

Offline

#8 2006-02-04 22:27:37

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: search results woes

1. Created search_results template, making sure it contains txp:article

Ah, this is what you said so I didn’t think you might have the wrong article tag. For search you should indeed use txp:article.

Offline

#9 2006-02-04 22:46:32

mwr
Member
From: Canada
Registered: 2006-01-31
Posts: 167
Website

Re: search results woes

No doubt I did something wrong. But I’ve reached the point where if I try to articulate it, my head may explode. The main thing is that it works … Whew!


Mark

Offline

Board footer

Powered by FluxBB