Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: soo_page_numbers: page counting and navigation widgets
As a first step, please check the version number of your installed soo_txp_obj plugin. It should be 1.0.b.4. I ask this in case the download link above gave you a cached version of the file.
Code is topiary
Offline
#50 2009-10-03 20:28:04
- leonardochen
- Member
- Registered: 2008-11-14
- Posts: 11
Re: soo_page_numbers: page counting and navigation widgets
1.0.b.4 and 0.2.4
Offline
Re: soo_page_numbers: page counting and navigation widgets
Is this on a Windows server/filesystem?
Edit: OK, ignore that, I now have a better sub-dir test setup and can reproduce the error.
Edit again: no I can’t, either.
One other question: are you using a RewriteBase
directive in your .htaccess?
Last edited by jsoo (2009-10-03 21:52:07)
Code is topiary
Offline
#52 2009-10-03 21:52:56
- leonardochen
- Member
- Registered: 2008-11-14
- Posts: 11
Re: soo_page_numbers: page counting and navigation widgets
Yes I do. And it is set to /diario RewriteBase /diario
I think you’re onto something and getting warmer :)
Offline
Re: soo_page_numbers: page counting and navigation widgets
leonardochen wrote:
I think you’re onto something and getting warmer :)
Maybe, maybe not. I have a working subdirectory installation and find that the site as a whole and soo_page_numbers in particular are working with:
- no RewriteBase directive
- RewriteBase /subdir/
- RewriteBase /subdir
If you have time to help me trace this, there are two tacks to take. First is to see if a different RewriteBase directive, such as above, works. Second tack involves putting some temporary echo
statements into the plugin code to track what’s happening. (I am assuming you are working on a development site, not a live site.) Let me know if .htaccess can’t fix it and if you are game: in that case email me.
Code is topiary
Offline
#54 2009-10-04 11:36:15
- leonardochen
- Member
- Registered: 2008-11-14
- Posts: 11
Re: soo_page_numbers: page counting and navigation widgets
Thank you Jeff. It was my mistake. Once I cleared the cache, the all links were displayed correctly. I think the new version of the library fixed the issue.
Offline
Re: soo_page_numbers: page counting and navigation widgets
Jeff,
On your download page, you mention that those who don’t need the full power of the soo_txp_obj library plugin can hack soo_page_numbers. However, following the instructions, I ran into this error:
Fatal error: Cannot access protected property soo_uri::$full in /Users/path/to/Sites/_txp-test/textpattern/lib/txplib_misc.php(594) : eval()’d code on line 44
Additionally adding the abstract class soo_obj {...}
code fixed that error and made the plugin output what I want. So far :-).
PS – Would it be possible to add a ‘previous page’ and ‘next page’ link ? – similar to the google paging thingie.
Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
Offline
Re: soo_page_numbers: page counting and navigation widgets
phiw13 wrote:
adding the
abstract class soo_obj {...}
code fixed that error and made the plugin output what I want.
Thanks very much — I’ve fixed the documentation accordingly. Obviously I never tested my own instructions …
PS – Would it be possible to add a ‘previous page’ and ‘next page’ link ? – similar to the google paging thingie.
You can use soo_page_count
(included in the plugin) for this. Example:
Edit: that was idiotic of me — might as well use <txp:newer />
…
Last edited by jsoo (2009-10-07 12:07:01)
Code is topiary
Offline
Re: soo_page_numbers: page counting and navigation widgets
jsoo wrote:
…
<txp:newer />
…
Hmm, not really. Theoretically, yes, that would output the required link. But it wouldn’t be part of the structure of the link bar. I’m using txp:soo_page_links wraptag="ul"
. Presentation-wise that can be ‘fixed’, but structurally I’d end up with a mess, and from an accessibility point of view it won’t be so pretty either.
The reason we would like to have the next/prev links is that makes it much easier & faster for keyboard users. When you use FAYT, you can easily page through a e.g. forum thread with a few keystrokes.
Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
Offline
Re: soo_page_numbers: page counting and navigation widgets
Give me an example of how you see the link bar structured. To me there’s no obvious place to include “next” and “prev” links within this kind of widget.
I could add {first} and {last} links to soo_page_count
, allowing widgets such as:
[first] [prev] current [next] [last]
which you could structure any way you want.
Code is topiary
Offline
Re: soo_page_numbers: page counting and navigation widgets
jsoo wrote:
Give me an example of how you see the link bar structured.
An unordered list, starting with ‘First’:
<ul><li>first</li><li>prev</li><li>1</li><li>2</li><li>...</li><li>next></li><li>last</li></ul>
(and I’ll wrap the whole thing in an HTML5 nav
element :-))
I think Obi1’s plugin can do it, but from the look of it is pretty much orphaned, and I’m not sure how the code stacks against current of future TXP codebase.
Last edited by phiw13 (2009-10-07 14:11:08)
Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
Offline
Re: soo_page_numbers: page counting and navigation widgets
ob1_pagination also has 23 attributes, including memorable names such as previoustexttitle
. I’m not saying plugins shouldn’t be set up that way, just that mine aren’t and won’t be. So far as I know the only limitation of ob1_pagination is that it doesn’t paginate lists by month, an obscure but standard Txp feature.
Were I to add {first} and {last} to soo_page_count
as I suggested above, and were I to add a wraptag
attribute also, you could accomplish your layout with:
<ul>
<txp:soo_page_count format="{first}" wraptag="li" />
<txp:soo_page_count format="{prev}" wraptag="li" />
<txp:soo_page_links break="li" />
<txp:soo_page_count format="{next}" wraptag="li" />
<txp:soo_page_count format="{last}" wraptag="li" />
</ul>
only difference being the extra link to the last page (parallel to the way you have two links to the first page).
It is obviously more code than just a single tag with a few attributes, but is fully customizable this way. (The purpose of the wraptag
is to prevent empty li
elements.) It would generate an empty ul
for one-page lists, but that shouldn’t be a problem.
Would that be useful to you?
Code is topiary
Offline