Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2012-08-01 10:29:53

Gallex
Member
Registered: 2006-10-08
Posts: 1,315

doubled search results

hi,

what could be wrong if search results are doubled?

i use this form:

<txp:if_search>
  <txp:article limit="99" pgonly="1" />
  <txp:if_search_results>
    <p>search results: <txp:search_result_count /></p>
    <txp:article limit="99" searchform="search_results" />
  <txp:else />
    <p>nothing found <strong><txp:search_term /></strong>.</p>
  </txp:if_search_results>
</txp:if_search>

Offline

#2 2012-08-01 12:59:21

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

Re: doubled search results

what do you have in the form search_results?


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

Offline

#3 2012-08-02 07:53:33

Gallex
Member
Registered: 2006-10-08
Posts: 1,315

Re: doubled search results

i use default form

<h3 class="entry-title"><txp:permlink><txp:title /></txp:permlink></h3>

<p class="published"><txp:posted /></p>

<p class="entry-summary"><txp:search_result_excerpt /></p>

<p class="small"><txp:permlink><txp:permlink /></txp:permlink></p>

<div class="divider"><txp:image id="1" /></div>

try yourself, type into search field ‘klubi’.
rulluisuklubi.ee/

Last edited by Gallex (2012-08-02 07:54:02)

Offline

#4 2012-08-02 08:03:57

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

Re: doubled search results

that seems in order. can you post the whole code of your default page? there might be something in there. Alternatively can you put the site on debug for us to check where the duplicate tag is?


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

Offline

#5 2012-08-02 08:24:26

Gallex
Member
Registered: 2006-10-08
Posts: 1,315

Re: doubled search results

putted on debug mode

Offline

#6 2012-08-02 08:42:10

etc
Developer
Registered: 2010-11-11
Posts: 5,397
Website GitHub

Re: doubled search results

I think each <txp:article /> outputs the search results? have not seen pgonly, sorry.

Edit: check however if you do not have another <txp:article /> somewhere.

Last edited by etc (2012-08-02 08:47:50)

Offline

#7 2012-08-02 08:48:26

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

Re: doubled search results

Can you change your initial code to:

<txp:if_search>
  <txp:article limit="99" pgonly="1" />
  <txp:if_search_results>
    <p>search results: <txp:search_result_count /></p>
    <txp:article limit="99">
<h3 class="entry-title"><txp:permlink><txp:title /></txp:permlink></h3>
<p class="published"><txp:posted /></p>
<p class="entry-summary"><txp:search_result_excerpt /></p>
<p class="small"><txp:permlink><txp:permlink /></txp:permlink></p>
<div class="divider"><txp:image id="1" /></div>
</txp:article>
  <txp:else />
    <p>nothing found <strong><txp:search_term /></strong>.</p>
  </txp:if_search_results>
</txp:if_search>

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 2012-08-02 08:52:57

etc
Developer
Registered: 2010-11-11
Posts: 5,397
Website GitHub

Re: doubled search results

I would suspect <txp:article limit="3" />.

Offline

#9 2012-08-02 09:18:52

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

Re: doubled search results

etc wrote:

I would suspect <txp:article limit="3" />.

That might be it!

try to include it in the if_search code

<txp:if_search>
  <txp:article limit="99" pgonly="1" />
  <txp:if_search_results>
    <p>search results: <txp:search_result_count /></p>
    <txp:article limit="99">
<h3 class="entry-title"><txp:permlink><txp:title /></txp:permlink></h3>
<p class="published"><txp:posted /></p>
<p class="entry-summary"><txp:search_result_excerpt /></p>
<p class="small"><txp:permlink><txp:permlink /></txp:permlink></p>
<div class="divider"><txp:image id="1" /></div>
</txp:article>
  <txp:else />
    <p>nothing found <strong><txp:search_term /></strong>.</p>
  </txp:if_search_results>
<txp:else />
<txp:article limit="3" />
</txp:if_search>

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

Offline

#10 2012-08-02 09:31:10

Gallex
Member
Registered: 2006-10-08
Posts: 1,315

Re: doubled search results

colak, it didn’t help

etc wrote:

I would suspect <txp:article limit="3" />.

could be, because it actually doubles only 3 results, but how to fix that. i need this limitation on news section

Offline

#11 2012-08-02 09:50:38

etc
Developer
Registered: 2010-11-11
Posts: 5,397
Website GitHub

Re: doubled search results

Move all this <txp:if_section name=" ,uudised"> part inside <txp:if_search>:

<txp:if_search>
  ...
<txp:else />
  <txp:if_section name=" ,uudised">
    ...
</txp:if_search>

Offline

#12 2012-08-02 10:05:03

Gallex
Member
Registered: 2006-10-08
Posts: 1,315

Re: doubled search results

nope. and this solution doubled my frontpage content as well ;)

Offline

Board footer

Powered by FluxBB