Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: soo_page_numbers: page counting and navigation widgets
Good morning Jeff!
I think I’m doing something wrong with your plugin. Is it possible to output pagination within an article list generated by txp:article_custom? ob1_pagination was giving me nothing, and I thought I broke it, but the soo_page_links tag isn’t outputting anything either.
Offline
Re: soo_page_numbers: page counting and navigation widgets
johnstephens wrote:
I think I’m doing something wrong with your plugin. Is it possible to output pagination within an article list generated by
txp:article_custom?
No. soo_page_numbers relies on the standard Txp $thispage global (I would expect ob1_pagination does too), so only works with article.
IIRC, chh_article_custom (no longer supported) allows pagination.
Depending on what selectors you need for this article list, soo_article_filter might be another possibility.
Code is topiary
Offline
#78 2010-02-24 10:29:55
- Gallex
- Member
- Registered: 2006-10-08
- Posts: 1,331
Re: soo_page_numbers: page counting and navigation widgets
jeff, after plugin installation and activation this error
Parse error: syntax error, unexpected T_CLASS in /home/tartulinnu/domains/estbirding.ee/public_html/textpattern/lib/txplib_misc.php(484) : eval()'d code on line 7
appears at the top of a page.
i have lots of other plugins installed – could it be some conflict there?
Offline
Re: soo_page_numbers: page counting and navigation widgets
Did you install soo_txp_obj or copy the needed classes into soo_page_numbers? My guess is that you did the latter and made an error such as leaving out a curly brace.
Code is topiary
Offline
#80 2010-02-24 13:30:43
- Gallex
- Member
- Registered: 2006-10-08
- Posts: 1,331
Re: soo_page_numbers: page counting and navigation widgets
jsoo wrote:
Did you install soo_txp_obj or copy the needed classes into soo_page_numbers? My guess is that you did the latter and made an error such as leaving out a curly brace.
yes i did, right away.
no error during/after installation.
uninstalled/installed 3 more times both files – same error
Offline
Re: soo_page_numbers: page counting and navigation widgets
Are you running PHP 5?
Code is topiary
Offline
#82 2010-02-24 14:22:41
- Gallex
- Member
- Registered: 2006-10-08
- Posts: 1,331
Re: soo_page_numbers: page counting and navigation widgets
jsoo wrote:
Are you running PHP 5?
4.4.7 :)
Offline
Re: soo_page_numbers: page counting and navigation widgets
Therein lies the problem.
Code is topiary
Offline
Re: soo_page_numbers: page counting and navigation widgets
Good morning! I’m seeing some strange pagination behavior on a site I just launched, and I’m probably doing it wrong. Here’s the skinny:
I’m using soo_page_numbers to generate the pagination links for the articles section, author-filtered articles section, and search results. Here’s the tag I’m using:
...
<txp:if_last_article>
<txp:soo_page_links
active_class="active"
break="li"
html_id="pagination-menu"
wraptag="ul"/><txp:else/><hr/>
</txp:if_last_article>
</txp:article>
As you can see looking at the articles page, there are not currently enough articles to generate page links. But if I filter the articles by an author, the pagination links appear, even though clicking on them yields no additional content.
I can’t figure out what I’ve done wrong. Please let me know if you see an obvious error in my code.
Thank you!
Offline
Re: soo_page_numbers: page counting and navigation widgets
jsoo wrote:
That is a very slick site!
I’m not familiar with chh_keywords, but did notice this note about its issues with clean URLs. Have you tried experimenting with any of those suggestions?
It is a little while that I brought up this issue (thanks for the kudos!), but I haven’t yet been able to fix it. On a new site that I am building I am using <txp:article /> with customfieldname="value". It gives me the same problem:
When a list of articles is created using keywords stored in custom fields, soo_page_numbers gives links to more pages than there actually are for that particular keyword. So you end up with pagination linking to pages that contain no articles.
Is this my set-up in some way, or an issue with the plugin?
• Old Photos of Japan – Japan in the 1850s~1960s (100% txp)
• MeijiShowa – Stock photos of Japan in the 1850s~1960s (100% txp)
• JapaneseStreets.com – Japanese street fashion (mostly txp)
Offline
Re: soo_page_numbers: page counting and navigation widgets
I didn’t realize it when I posted my previous comment, but my issue appears to be the same as the one that John Stephens describes in the post above mine, albeit for authors instead of custom fields.
So this appears to be a problem in the code?
• Old Photos of Japan – Japan in the 1850s~1960s (100% txp)
• MeijiShowa – Stock photos of Japan in the 1850s~1960s (100% txp)
• JapaneseStreets.com – Japanese street fashion (mostly txp)
Offline
Re: soo_page_numbers: page counting and navigation widgets
John, Kjeld: apologies for the delay; I’ve been traveling. In some very quick testing on author searches I am unable to duplicate this error. I haven’t tried the custom field setup yet.
All of the calculations this plugin does are based on the $thispage global, particularly $thispage['numPages']. Txp sets this in the doArticles() function, the main function called by the article tag.
Are there any other article tags, or other plugin tags, that could be changing the value of this variable?
You can check the value of $thispage['numPages'] by adding this to your page template, just above the soo_page_links tag:
<txp:php>global $thispage;dmp($thispage);</txp:php>
(You can enclose this in HTML comment delimiters if you don’t want it to pollute live pages.)
Code is topiary
Offline
Re: soo_page_numbers: page counting and navigation widgets
Thanks for your reply, Jeff!
Here’s the output for the unfiltered articles list:
array (
'pg' => 1,
'numPages' => 1,
's' => 'articles',
'c' => '',
'grand_total' => '10',
'total' => 10,
)
At this point, the site has only ten articles— and the “limit” variable is set to 30, so it is not paginating.
Here’s the output of the same dump on a page of articles in the same section filtered by an author URL-variable:
array (
'pg' => 1,
'numPages' => 2,
's' => 'articles',
'c' => '',
'grand_total' => '2',
'total' => 2,
)
soo_page_links displays links to a second page of results, but there is only one article associated with the current author, so I don’t know why Textpattern thinks there should be multiple pages of results.
I hope this helps!
Offline
Re: soo_page_numbers: page counting and navigation widgets
Hi Jeff, thanks.
I discovered that on both sites the problem resulted from having an article tag containing a pgonly="1" attribute on the page. Like this:
<txp:article limit="1" pgonly="1" searchall="0" />
The problem vanished after removing this tag. The drawback is that I can’t give a count of the number of articles found…
Your piece of code aided me in finally figuring this out. Thanks.
Maybe the help file of the soo_page_numbers plugin should warn people that the plugin can’t count the correct number of pages for articles filtered by custom field (and author, perhaps, John?) if there’s an article tag with a pgonly attribute on the page.
Once again, great plugin, Jeff!
• Old Photos of Japan – Japan in the 1850s~1960s (100% txp)
• MeijiShowa – Stock photos of Japan in the 1850s~1960s (100% txp)
• JapaneseStreets.com – Japanese street fashion (mostly txp)
Offline
Re: soo_page_numbers: page counting and navigation widgets
I’m glad you found the independent variable in your case, Kjeld!
To clarify, I do not have a single instance of a pgonly attribute on this entire site.
Offline