Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#13 2007-06-28 20:27:43
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: Pagination on search page
Hmm. Yeah, we can clean it up a bit, so it’s easier to see what’s happening:
<div id="content">
<txp:if_search>
<h3><a name="search-results"><txp:article searchsticky="1" pgonly="1" /><txp:search_result_count text="Results" /></a></h3>
<txp:article searchsticky="1" form="homepage" />
<p><txp:newer>« Previous results</txp:newer> |
<txp:older>Next 10 of <txp:search_result_count text="results" /> »</txp:older></p>
<txp:else />
<txp:article searchsticky="1" limit="5" form="homepage" />
<p><txp:older><txp:text item="older" /></txp:older>
<txp:newer><txp:text item="newer" /></txp:newer></p>
</txp:if_search>
</div>
Make sure when you try the search to use terms that appear in articles not shown on the front page.
Offline
#14 2007-06-28 20:42:54
- Nic
- Member
- Registered: 2007-06-08
- Posts: 21
Re: Pagination on search page
I swapped in your code and the older tags still move to the page 2 instead of the search page 2. Tag trace below:
<!-- txp tag trace:
[SQL (0.000995): select name from txp_lang where lang='en-us' limit 1]
[SQL (0.007861): select name, data from txp_lang where lang='en-us' AND ( event='public' OR event='common')]
[SQL (0.027794): select name, code, version from txp_plugin where status = 1]
[SQL (0.001259): select name, html as type from txp_prefs where event = 'permlinks' AND html <> 'gbp_partial']
[SQL (0.000916): select * from txp_section where name = 'default' limit 1]
[SQL (0.000773): insert into txp_log set `time`=now(),page='/mediaaccess/?q=policy',ip='127.0.0.1',host='127.0.0.1',refer='',status='200',method='GET']
[SQL (0.002311): select REPLACE(name, 'gbp_permanent_links_', '') AS id from txp_prefs where `event` = 'permlinks' AND `name` REGEXP '^gbp_permanent_links_.{13}$']
[SQL (0.001567): select user_html from txp_page where name='home']
[Page: home]
<txp:page_title/>
<txp:feed_link flavor="atom" format="link" label="Atom" />
<txp:feed_link flavor="rss" format="link" label="RSS" />
<txp:if_search>
[<txp:if_search>: true]
<txp:css format="link" n="default" />
</txp:if_search>
<txp:text item="go_content" />
<txp:text item="go_nav" />
<txp:text item="go_search" />
<txp:if_search>
[<txp:if_search>: true]
<txp:link_to_home>
<txp:sitename/>
</txp:link_to_home>
<txp:output_form form="top_navigation" />
[SQL (0.000749): select Form from txp_form where name='top_navigation']
[Form: top_navigation]
<txp:gbp_disable_permlinks>
<txp:section_list include_default="1" default_title="Home" sections="press, about" break="li" />
[SQL (0.001471): select name, title from txp_section where name in ('press','about') order by field(name, 'press','about')]
</txp:gbp_disable_permlinks>
<txp:site_url/>
<txp:search_input label="" wraptag="" />
[SQL (0.000590): select form from txp_form where `name` = 'search_input' limit 1]
<txp:page_title/>
</txp:if_search>
<txp:output_form form="sidebar_navigation" />
[SQL (0.000604): select Form from txp_form where name='sidebar_navigation']
[Form: sidebar_navigation]
<txp:category_list section="issues" break="li" wraptag="ul" categories="media-ownership, network-neutrality, open-access, lpfm, public-interest, broadcast-free-speech, civil-rights" />
[SQL (0.002705): select name, title from txp_category where type = 'article' and name in ('media-ownership','network-neutrality','open-access','lpfm','public-interest','broadcast-free-speech','civil-rights') order by field(name, 'media-ownership','network-neutrality','open-access','lpfm','public-interest','broadcast-free-speech','civil-rights')]
<txp:site_url/>
<txp:site_url/>
<txp:site_url/>
<txp:site_url/>
<txp:article_custom section="about" sort="Title asc" limit="99" form="sidebar_links" />
[SQL (0.006375): select *, unix_timestamp(Posted) as uPosted from textpattern where 1 and Status = 4 and Posted <= now() and Section = 'about' order by Title asc limit 0, 99]
[SQL (0.000788): select Form from txp_form where name='sidebar_links']
[Form: sidebar_links]
[article 258]
<txp:permlink>
<txp:title/>
</txp:permlink>
[article 261]
<txp:permlink>
<txp:title/>
</txp:permlink>
[article 262]
<txp:permlink>
<txp:title/>
</txp:permlink>
[article 257]
<txp:permlink>
<txp:title/>
</txp:permlink>
[article 256]
<txp:permlink>
<txp:title/>
</txp:permlink>
[article 259]
<txp:permlink>
<txp:title/>
</txp:permlink>
[article 260]
<txp:permlink>
<txp:title/>
</txp:permlink>
[article 263]
<txp:permlink>
<txp:title/>
</txp:permlink>
<txp:if_search>
[<txp:if_search>: true]
</txp:if_search>
<txp:if_search>
[<txp:if_search>: true]
<txp:article searchsticky="1" pgonly="1" />
[SQL (0.000984): select name from txp_section where searchable != '1']
[SQL (0.182676): select count(*) from textpattern where 1 and Status >= 4 and Posted <= now() and (Title rlike 'policy' or Body rlike 'policy') and Section != 'archive']
<txp:search_result_count text="Results" />
<txp:article searchsticky="1" form="homepage" />
[SQL (0.000894): select name from txp_section where searchable != '1']
[SQL (0.182457): select count(*) from textpattern where 1 and Status >= 4 and Posted <= now() and (Title rlike 'policy' or Body rlike 'policy') and Section != 'archive']
[SQL (0.200196): select *, unix_timestamp(Posted) as uPosted, match (Title,Body) against ('policy') as score from textpattern where 1 and Status >= 4 and Posted <= now() and (Title rlike 'policy' or Body rlike 'policy') and Section != 'archive' order by score desc limit 0, 10]
[SQL (0.002705): select Form from txp_form where name='search_results']
[Form: search_results]
[article 269]
<txp:permlink>
<txp:title/>
</txp:permlink>
<txp:search_result_excerpt/>
<txp:permlink>
<txp:permlink/>
</txp:permlink>
<txp:posted/>
[article 164]
<txp:permlink>
<txp:title/>
</txp:permlink>
<txp:search_result_excerpt/>
<txp:permlink>
<txp:permlink/>
</txp:permlink>
<txp:posted/>
[article 168]
<txp:permlink>
<txp:title/>
</txp:permlink>
<txp:search_result_excerpt/>
<txp:permlink>
<txp:permlink/>
</txp:permlink>
<txp:posted/>
[article 150]
<txp:permlink>
<txp:title/>
</txp:permlink>
<txp:search_result_excerpt/>
<txp:permlink>
<txp:permlink/>
</txp:permlink>
<txp:posted/>
[article 238]
<txp:permlink>
<txp:title/>
</txp:permlink>
<txp:search_result_excerpt/>
<txp:permlink>
<txp:permlink/>
</txp:permlink>
<txp:posted/>
[article 264]
<txp:permlink>
<txp:title/>
</txp:permlink>
<txp:search_result_excerpt/>
<txp:permlink>
<txp:permlink/>
</txp:permlink>
<txp:posted/>
[article 54]
<txp:permlink>
<txp:title/>
</txp:permlink>
<txp:search_result_excerpt/>
<txp:permlink>
<txp:permlink/>
</txp:permlink>
<txp:posted/>
[article 244]
<txp:permlink>
<txp:title/>
</txp:permlink>
<txp:search_result_excerpt/>
<txp:permlink>
<txp:permlink/>
</txp:permlink>
<txp:posted/>
[article 47]
<txp:permlink>
<txp:title/>
</txp:permlink>
<txp:search_result_excerpt/>
<txp:permlink>
<txp:permlink/>
</txp:permlink>
<txp:posted/>
[article 260]
<txp:permlink>
<txp:title/>
</txp:permlink>
<txp:search_result_excerpt/>
<txp:permlink>
<txp:permlink/>
</txp:permlink>
<txp:posted/>
<txp:newer>
</txp:newer>
<txp:older>
<txp:search_result_count text="results" />
</txp:older>
</txp:if_search>
<txp:output_form form="footer" />
[SQL (0.002023): select Form from txp_form where name='footer']
[Form: footer]
<txp:gbp_disable_permlinks>
<txp:site_url/>
<txp:site_url/>
<txp:feed_link label="RSS" />
<txp:feed_link flavor="atom" label="Atom" />
</txp:gbp_disable_permlinks>
[ ~~~ secondpass ~~~ ]
-->
Is there anything else I can do to make this troubleshooting easier? I’m fairly new to Textpattern and I’m kinda confused as to what seem to be causing the issue.
Offline
#15 2007-06-28 20:51:38
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: Pagination on search page
I notice that you appear to have gbp_permanent_links installed. Could you disable it and any other plugins that fiddle with permlinks?
Offline
#16 2007-06-28 21:11:39
- Nic
- Member
- Registered: 2007-06-08
- Posts: 21
Re: Pagination on search page
Aha! I guess saying that plugin was up would have helped in the first place; I apologize for that omission.
I’ve been having trouble with that plugin in other areas too. There was an option in there for “clean page archive links” that caused that error (from my understanding), so I turned it off. I guess if I want to have clean page numbers, my only option is to include all results? Suppose that’s more of a rhetorical question than anything.
Thank you so much for your help! I’ve always been reluctant to ask for assistance, especially not knowing my way around, but it’s been very helpful.
Offline