Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: soo_page_numbers: page counting and navigation widgets
johnstephens wrote:
To clarify, I do not have a single instance of a
pgonlyattribute on this entire site.
It looks like you have a sticky article on your page, John, or a custom article tag, or am I mistaken? Anyway, it appears like you have two article tags on your page. Maybe that’s where the clash happens on your page?
• 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
Perhaps in my case the problem lay not in pgonly attribute, but in the fact there were two article tags on the page…
• 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
It’s true that I use multiple article tags on each page, and if soo_pn doesn’t work with that I need another pagination method.
Offline
Re: soo_page_numbers: page counting and navigation widgets
OK, here’s a little more explanation that might help. As Txp goes through the page template, when it hits a soo_page_links tag, soo_page_links checks to see whether or not the $thispage global has been set. If it has, soo_page_links produces its output based on the current values in $thispage at that point.
If, however, $thispage hasn’t been set yet, i.e. soo_page_links is above all article tags in the page template, then soo_page_links makes use of Txp’s second parse() pass. This is so you can have the page links appear before the article output, without the need for an empty article tag with pgonly set.
But if there are multiple Edit: looking more closely I see this isn’t true — article tags on the page, and soo_page_links is above all of them, then soo_page_links will always end up with $thispage values from the last article tag. This is true no matter how the pgonly attribute is set in any of those article tags.$thispage does not get overridden by subsequent article tags.
So when using multiple Edit: Hence, it’s crucial that the first non-custom, non-sticky article tags, it is essential to place the soo_page_links tag after the one you want to paginate and before any others.article tag on the page is the one you want to paginate.
I hope that makes sense, and I will see about adding a similar explanation to the plugin help.
Last edited by jsoo (2010-05-26 17:55:12)
Code is topiary
Offline
Re: soo_page_numbers: page counting and navigation widgets
Thanks, Jeff. So the clash was indeed in the multiple article tags as I suspected. Glad that’s clear now. Good luck, John! I hope you can make it work.
• 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 don’t think that applies to what I’m seeing— I have soo_page_links nested in the article tag I want to paginate— like this:
<txp:article limit="30">
... Article title and other info ...
<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>
Does that make sense? From what you’ve said, it seem’s like soo_page_links should be getting $thispage from the context of the relevant article list, right?
The other article lists on this page come after soo_page_links.
Offline
Re: soo_page_numbers: page counting and navigation widgets
John, please see my edited explanation above. I didn’t realize that $thispage does not get overridden. Hence pagination will be based on the first non-sticky, non-custom article tag on the page, no matter where you put soo_page_links.
Code is topiary
Offline
Re: soo_page_numbers: page counting and navigation widgets
Aha! Thank you for the guidance, Jeff. Here’s what was going on, for posterity:
My author pages on this site include author bios generated by smd_bio. The only way I could figure out to get smd_bio to recognize the author currently in context was to include txp:article tags with a limit set to 1— in the template, this takes place above the article list I want to paginate. They look like this:
<txp:article limit="1"><txp:smd_bio_info items="img_id">{smd_bio_img_id}</txp:smd_bio_info></txp:article>
With a limit of 1, a list that contained more than one article would show multiple pages, even if the article list containing the pagination had a threshold of thirty articles per page.
Based on your edited explanation, this addition above the txp:if_author block, gave soo_page_links the correct number of pages:
<txp:if_article_list><txp:article pgonly="1" limit="30"/>
<txp:if_author>
... Author info ...
Offline
Re: soo_page_numbers: page counting and navigation widgets
i don t understand, why paginations don’t work for me…
i doin all right.
Last edited by Katalonian (2010-07-09 08:00:07)
<txp:txp_me />
Offline
#100 2010-07-09 09:47:04
Re: soo_page_numbers: page counting and navigation widgets
I’m sorry you’re having problems, but you’ve posted no information that allows me to help you. If nothing else please post or link to a tag trace.
Code is topiary
Offline
#101 2010-07-30 09:07:17
Re: soo_page_numbers: page counting and navigation widgets
if you don’t need soo_txp_obj for something else. Delete the require_plugin(‘soo_txp_obj’) line, and paste in the following two classes from soo_txp_obj: soo_obj (at the top of soo_txp_obj) and soo_uri (at the bottom).
I´m not a php crack, please which 2 classes I need? I don´t understand the php code and I don´t know where the class beginns and stops
Offline
#102 2010-07-30 20:20:46
Re: soo_page_numbers: page counting and navigation widgets
Simplest thing is to keep the two plugins as is. But to answer your question, copy everything from the line
class soo_uri
up to
# --- END PLUGIN CODE
Just be aware that if you copy too much or too little, you can disable the entire site.
Edited by net-carver to show the end line as code.
Last edited by net-carver (2010-07-30 21:15:28)
Code is topiary
Offline
#103 2010-07-31 05:23:23
Re: soo_page_numbers: page counting and navigation widgets
Thanks jsoo
Offline
#104 2011-01-18 12:24:28
Re: soo_page_numbers: page counting and navigation widgets
Version 0.3.0 released. Thanks to much help from the Txp community, soo_page_numbers now speaks your language. That is, if you speak one of the 21 languages included in the plugin’s Textpack for preformatted output (e.g., “Page 1 of 2”) The plugin now also uses Txp’s built-in language item for “Page” in link titles (e.g., <a href=”/?pg=2” title=“Page 2”>2</a>).
Code is topiary
Offline
#105 2011-03-31 14:06:29
Re: soo_page_numbers: page counting and navigation widgets
Hi Jeff,
Thank you for developing this plug-in, it’s very useful particularly as ob1_pagination appears to have disappeared.
I’m working-up a page where I’m looking at adding pagination to article lists but it seems to be counting individual articles rather than treating each block as a page. You can see it in action here, I have 5 test articles with a limit of 3 per page so the pagination should indicate 2 pages. My code is:
<txp:if_article_list>
<txp:article_custom allowoverride="0" form="article_post" limit="3" offset="1" pgonly="0" section="news" sort="Posted desc" status="4" />
<txp:soo_page_links />
</txp:if_article_list>
I may be doing it all wrong but would appreciate any help, thanks.
Offline