Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#25 2008-09-15 22:25:46

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

Re: Search Page

Edited my post.

Offline

#26 2008-09-15 22:32:03

driz
Member
From: Huddersfield, UK
Registered: 2008-03-18
Posts: 441
Website

Re: Search Page

Urgh I’m super confused now, which tags am I using here :S

I have the if_search to detect if we are searching or not, ie you have searched or are just on the search page
and I have the if_search_results to detect if we have search results or not and show either a yes or no answer

Which one needs wrapping inside the other (if at all).

Thank you


~ Cameron

Offline

#27 2008-09-15 22:44:26

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

Re: Search Page

Not sure why it isn’t working, but for clarity, I would write the last part of your code as this:

<txp:if_search>
  <txp:if_search_results>
    <p>These articles match your search request: </p>
    <txp:article form="search_results" sort="Section asc" />
  <txp:else />
    <p>Sorry, we were not able to find a page matching your search request <strong><txp:search_term /></strong>.</p>
  </txp:if_search_results>
<txp:else />
  <p>No Content Available...</p>
</txp:if_search>

La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#28 2008-09-15 22:53:11

driz
Member
From: Huddersfield, UK
Registered: 2008-03-18
Posts: 441
Website

Re: Search Page

okies, now the search ALWAYS says no results were found (it doesnt display them either) :P

there are several articles called Lorem Ipsum, and here is a test search: http://www.simplecandy.com/search?q=lorem+ip

But the results don’t show :S

Last edited by driz (2008-09-15 22:56:21)


~ Cameron

Offline

#29 2008-09-15 23:04:08

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

Re: Search Page

We forgot to tell you about pgonly: just put <txp:article pgonly="1" /> before the if_search_results tag. It doesn’t display anything but it is needed to count the articles.

<txp:if_search>
<txp:article pgonly="1" />
  <txp:if_search_results>
    <p>These articles match your search request: </p>
    <txp:article form="search_results" sort="Section asc" />
  <txp:else />
    <p>Sorry, we were not able to find a page matching your search request <strong><txp:search_term /></strong>.</p>
  </txp:if_search_results>
<txp:else />
  <p>No Content Available...</p>
</txp:if_search>

Offline

#30 2008-09-15 23:09:24

driz
Member
From: Huddersfield, UK
Registered: 2008-03-18
Posts: 441
Website

Re: Search Page

Out of curiosity, how many be default (search links) will be displayed and do they have pagination?

And the code changed fixed the bug, cheers :) x

Last edited by driz (2008-09-15 23:10:19)


~ Cameron

Offline

#31 2008-09-15 23:20:18

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

Re: Search Page

Search :)

Edit: OK, that search id didn’t last very long… if you search the forum for pagination AND search AND results you will find some useful topics.

Last edited by els (2008-09-16 14:37:45)

Offline

#32 2008-09-15 23:21:08

MattD
Plugin Author
From: Monterey, California
Registered: 2008-03-21
Posts: 1,254
Website

Re: Search Page

<txp:article/> will display all articles unless told to do otherwise by it’s Attributes


My Plugins

Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker

Offline

#33 2008-09-16 06:50:08

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,733
Website

Re: Search Page

MattD wrote:

<txp:article/> will display all articles unless told to do otherwise by it’s Attributes

No, if I’m not mistaken the default for limit is 10 (see limit attribute in textbook)

Set limit="999" to get ‘all’ (=up to 999) results.

Last edited by jakob (2008-09-16 06:50:58)


TXP Builders – finely-crafted code, design and txp

Offline

#34 2008-09-16 15:42:12

MattD
Plugin Author
From: Monterey, California
Registered: 2008-03-21
Posts: 1,254
Website

Re: Search Page

Doh!

limit="integer" 
The number of articles to display. Default is 10. 

Note to self: Read before posting Matt!


My Plugins

Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker

Offline

#35 2008-10-05 23:42:15

mattmikulla
Member
From: Nashville Tennessee
Registered: 2004-08-25
Posts: 281
Website

Re: Search Page

Using that code I am getting…

When a search is met at the bottom after the search results by default: “These articles match your search request:”

When no articles can be found: Sorry, we were not able to find a page matching your search request blahblah.
And: Seems like you are looking for a very common search term. You’d better use a more specific search phrase.

How can I get rid of those statements. They are unstyled and I would like them removed.

Note – Edit: I have started a new thread about this topic here: http://forum.textpattern.com/viewtopic.php?id=28563

Last edited by mattmikulla (2008-10-07 21:59:25)


Art Rogue – Fine Art Photography

Offline

Board footer

Powered by FluxBB