Textpattern CMS support forum

You are not logged in. Register | Login | Help

#21 2009-09-10 11:25:52

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,781
Website

Re: soo_page_numbers: page counting and navigation widgets

txpnisti: Yes, the plugin should work with search results. Please describe your custom search page, and the kind of URLs the plugin is giving you.

Kostas: Let me work on that. Any particular usage you are interested in?

All: Pardon me if I am slow to respond this week; I have only intermittent online access.


Code is topiary

Offline

#22 2009-09-10 13:05:47

txpnisti
Member
Registered: 2009-02-25
Posts: 23

Re: soo_page_numbers: page counting and navigation widgets

jsoo, thanks for the info. So it is something with my setup then. Let me try to explain:

In every page I have the search: form method=“get” action=“http://sub.domain.com/searchresults/”

And I have a section named “searchresults” for results. It works fine with built in pagination controls.

But when I add this widget there, if seeing right, pagination links are pointing to the section where you were when you hitted the search. (if you used search from the section “about”, search result pagenumbers points then to that section – with correct page number still attached)

So instead showing additional pages on custom search page, they are shown on previously visited section/its template.

Along the subdomain installation, I also have MLP installed. These both maybe could affect. But it still doesn’seem to mess with languages, just with sections.

Offline

#23 2009-09-10 13:25:32

kostas45
Member
From: Greece
Registered: 2007-11-08
Posts: 61

Re: soo_page_numbers: page counting and navigation widgets

jsoo wrote:

Kostas: Let me work on that. Any particular usage you are interested in?

I am using smd_query in a form to do fulltext search against keywords field.
I am trying to figure out if I can use your plugin to paginate resulting rows.

Thanks,
Kostas

Offline

#24 2009-09-10 14:11:41

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,566
Website

Re: soo_page_numbers: page counting and navigation widgets

kostas45 wrote:

I am using smd_query in a form … I am trying to figure out … paginate resulting rows.

As an aside, you can do it with smd_query (perhaps in tandem with this plugin) and supply smd_query with an offset to its LIMIT N,MAX. Use the URL vars to send the page number to each page, sanitize the value to make sure it’s numeric and then plug the relevant values into the query, where N is the page number * number of items you want to show per page.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#25 2009-09-10 15:29:06

kostas45
Member
From: Greece
Registered: 2007-11-08
Posts: 61

Re: soo_page_numbers: page counting and navigation widgets

Stef, thank you for the tip.
However, to me it looks like reinventing the wheel…
I ‘ll see if I can come up to anything working.

Cheers,
Kostas

Offline

#26 2009-09-11 01:43:05

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,781
Website

Re: soo_page_numbers: page counting and navigation widgets

txpnisti wrote:

So it is something with my setup then.

I’m not certain that it is, but I think so. I’ve just tested a similar setup, with a search input form in one section and the search results in another, and I am getting correct links from soo_page_links. (You can see this by going to the Txp section of my website and typing a search term into the search box at the bottom of the page (which I’ve just stuck there temporarily). Try a term such as “textpattern” to get a few pages of results. I’ve stuck both the <txp:older /> and <txp:newer /> tags as well as soo_page_links onto the page.

I’ve tried this both with the <txp:search_input section="search" /> tag and with hard-coded HTML, and both worked on my setup. Are you using <txp:search_input />?

Along the subdomain installation, I also have MLP installed. These both maybe could affect. But it still doesn’seem to mess with languages, just with sections.

I vaguely recall that MLP does some URL manipulation and quite possibly there is an incompatibility with my plugin. I will look into this, but will probably not be able to for a few days.


Code is topiary

Offline

#27 2009-09-11 01:49:25

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,781
Website

Re: soo_page_numbers: page counting and navigation widgets

kostas45 wrote:

I am using smd_query in a form to do fulltext search against keywords field.
I am trying to figure out if I can use your plugin to paginate resulting rows.

soo_page_numbers depends on the global $thispage array. In short, it only paginates output from a <txp:article /> tag. So I doubt it will work with results from smd_query.


Code is topiary

Offline

#28 2009-09-11 06:23:56

kostas45
Member
From: Greece
Registered: 2007-11-08
Posts: 61

Re: soo_page_numbers: page counting and navigation widgets

jsoo wrote:

soo_page_numbers depends on the global $thispage array. In short, it only paginates output from a <txp:article /> tag. So I doubt it will work with results from smd_query.

Ah, I see.
I suspected so, but was not in the Help, so now I know.

Thanks anyway,
Kostas

Offline

#29 2009-09-11 06:35:08

txpnisti
Member
Registered: 2009-02-25
Posts: 23

Re: soo_page_numbers: page counting and navigation widgets

jsoo, I’m using hardcoded input, but I’don’t think that make any difference here. Maybe it is something with the MLP.

Offline

#30 2009-09-11 09:52:32

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,781
Website

Re: soo_page_numbers: page counting and navigation widgets

txpnisti wrote:

jsoo, I’m using hardcoded input, but I’don’t think that make any difference here. Maybe it is something with the MLP.

I’m quite sure you’re right about hardcoded vs. tag — I don’t think search_input does anything tricky. It does use a hidden input for the section instead of including it in the action attribute; I doubt that will make a difference, but you might try it just to check.

After some looking into MLP, I see that the issue is that MLP changes the value of $_SERVER['REQUEST_URI'], on which my plugin depends. Furthermore, MLP makes every effort to be first in line — highest priority plugin load order, a callback on pretext, and even sneaks to the front of the callback array for good measure. I don’t know that it will be possible for me to get around this and achieve compatibility with MLP.

Although maybe, just maybe, if I try the same trick of jumping to the front of the callback array, I would get in ahead of MLP by keeping a standard medium-priority plugin load order. Turnabout is fair play. When I have time I will certainly look into this.

Edit: Still, what surprises me is that when I had a previous issue with MLP and pagination in a different plugin, the resolution was a simple MLP issue. That other plugin uses the same mechanism for pagination as this one. Now I am wondering why that worked, given MLP’s manipulation of $_SERVER['REQUEST_URI'].

Last edited by jsoo (2009-09-11 10:14:54)


Code is topiary

Offline

Board footer

Powered by FluxBB