Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2009-04-22 11:59:48
- mark.adams82
- Member
- Registered: 2008-05-27
- Posts: 14
Pagination Problem
Hi guys, hopefully someone can save me tearing my hair out on this.
I am having no luck whatsoever in getting either ob1 pagination tags or the native txp:older/newer tags to give any output in a news section of a site I am working on.
I have searched ceaselessly for a resolution online, but no luck. This makes me think it is a setting somewhere, or a very basic error which I have not picked up on.
The code calling the pagination is as follows:
<txp:if_section name=“news”>
<txp:if_individual_article>
<txp:article limit=“1”/>
<a href=”<txp:site_url />news” title=“Back to news index”><strong>« Back to News</strong></a>
<txp:else />
<txp:chh_if_data>
<txp:article_custom section=“news” limit=“1” Article_Type=“Main” />
<div id=“news-list”>
<txp:article limit=“2” form=“article_newslist” Article_Type=“Sub” />
</div>
<txp:else />
<txp:output_form form=“no_content” />
</txp:chh_if_data>
</txp:if_individual_article>
<txp:output_form form=“panel_pagination” />
</txp:if_section>
This produces the news articles as desired (of which there are 4 in total) and displays 2.
There are, however no pagination links output on the page and its driving me mad as to why!!
I feel like ive checked and double-checked everything, but no joy.
The panel_pagination is as follows:
<txp:chh_if_data>
<div class=“pagination”>
<txp:ob1_pagination moretabsdisplay=“1” maximumtabs=“8” firsttext=“First” previoustext=”« Previous” nexttext=“Next »” lasttext=“Last” outputlastfirst=“0” outputnextprevious=“1” ulclass=“pagination” liclass=“pagination” ulid=“pagination” liselected=“paginationCurrent” liempty=“paginationEmpty” />
</div>
<txp:else />
</txp:chh_if_data>
<txp:older /> | <txp:newer />
I added the native textpattern tags at the bottom looking for at least some kind of output, but the only thing that displays is the | on its own.
I would post this in the ob1 plugin thread, but i’m pretty sure its not related to the plugin as even the native tags are failing to display. It just doesnt seem to be recognising the fact that there are further articles in this section in addition to those filtered out by limit=“2”
Any help would be massively appreciated.
Thanks in advance
Offline
Re: Pagination Problem
I think the problem lies with using the <txp:article_custom /> tag. This would apply both to native and ob1_pagination tags. You may have to rethink your method.
Stuart
In a Time of Universal Deceit
Telling the Truth is Revolutionary.
Offline
#3 2009-04-22 15:03:58
- mark.adams82
- Member
- Registered: 2008-05-27
- Posts: 14
Re: Pagination Problem
thebombsite wrote:
I think the problem lies with using the <txp:article_custom /> tag. This would apply both to native and ob1_pagination tags. You may have to rethink your method.
Thanks for your input – I considered this as a possibility and changed the article_custom tag to a plain old article tag, but this has no effect unfortunately.
Its baffling! Stripping the page down so that it only shows these articles with no page template still won’t produce any pagination links!
Nothing is being output from the ob1 tag or the native pagination tags – running out of things to try.
I think I’ve broken textpattern. :(
Offline
Re: Pagination Problem
Actually, just reading through your code again, there is no attribute “Article_Type” for either of the article tags.
In “Preferences” do you have “Production Status” set to “de-bugging”? If you do you can view the page source and at the bottom see how Textpattern is parsing the page. See if there are any errors showing or maybe a “false” when you would expect to see a “true”.
I’m also wondering about having 2 tags in operation. You aren’t using the “offset” attribute in the second tag. I’m sure there’s a way of doing this with 2 tags but I will have to search around for it. I’m sure it involves “pgonly”.
Wrong! Look at Example 4 here.
Last edited by thebombsite (2009-04-22 15:29:50)
Stuart
In a Time of Universal Deceit
Telling the Truth is Revolutionary.
Offline
#5 2009-04-22 15:51:30
- mark.adams82
- Member
- Registered: 2008-05-27
- Posts: 14
Re: Pagination Problem
Thanks again. Sorry, I should have mentioned the Article_Type attribute is a custom field (glz_custom_fields) so that’s why it is there. I have tried it removing this attribute, but alas no joy.
Yup – I’ve looked through using the debugger – news articles are being parsed as true, the pagination is being parsed like this:
<txp:output_form form=“panel_pagination” /> [SQL (): select Form from txp_form where name=‘panel_pagination’] [Form: panel_pagination] <txp:ob1_pagination moretabsdisplay=“1” maximumtabs=“8” firsttext=“First” previoustext=”« Previous” nexttext=“Next »” lasttext=“Last” outputlastfirst=“0” outputnextprevious=“1” ulclass=“pagination” liclass=“pagination” ulid=“pagination” liselected=“paginationCurrent” liempty=“paginationEmpty” /> <txp:older /> <txp:newer /> <txp:older> </txp:older> <txp:newer> </txp:newer> </txp:if_individual_article>
Whether that means it processing the links or not isn’t clear to me.
I’ve tried several different combinations of attributes, offsets and custom fields and none seem to give me anything on the page that isnt hard-coded.
Another strange thing is that copying the exact code from other sites we have made where pagination works fine, it doesnt work on this one. Ive just finished a re-install of txp 4.0.8 and imported the database, but again without any luck.
Thanks for the time you’ve spent looking at this. :)
Last edited by mark.adams82 (2009-04-22 15:53:39)
Offline
Re: Pagination Problem
Did you look at the example I posted?
Stuart
In a Time of Universal Deceit
Telling the Truth is Revolutionary.
Offline
#7 2009-04-22 16:04:48
- mark.adams82
- Member
- Registered: 2008-05-27
- Posts: 14
Re: Pagination Problem
Yeah certainly did, but still absolutely no sign of any link being output. Alas.
Offline
Re: Pagination Problem
Mmmm. I’m stuck then I’m afraid. See if anyone else can help.
Stuart
In a Time of Universal Deceit
Telling the Truth is Revolutionary.
Offline
#9 2009-04-22 18:05:43
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Pagination Problem
You wrapped your pagination tags in chh_if_data tags, which seems a bit odd to me… Have you tried if removing them makes a difference?
This produces the news articles as desired (of which there are 4 in total) and displays 2.
It doesn’t. You have two article tags, one with limit="1"
and one with limit="2"
, so you are displaying 3 articles. As far as I know, when you have more than one article tag on your page, you need to use the pageby
attribute in all of them, otherwise the pagination won’t work. So like this:
<txp:article form="thisform" limit="1" pageby="3" />
<txp:article form="thatform" limit="2" pageby="3" />
But if you are trying to keep the first article on the page, and have the pagination just work for the other two articles, I doubt if that is at all possible…
Last edited by els (2009-04-22 18:18:48)
Offline
#10 2009-04-23 05:52:33
- rsilletti
- Moderator
- From: Spokane WA
- Registered: 2004-04-28
- Posts: 707
Re: Pagination Problem
If you have your article and article_custom tags wrapped in if_individual_article conditionals, would you generate any pagination statistics with a call to either of your article tags in article list mode?
Offline
Re: Pagination Problem
Hi Mark,
I saw your comment on the TXP Tips article on pagination.
There seems to be a few errors with your code – I suggest you first start with very basic tags (like in the TXP Tips article) and build from there. I know you said you have tried this, but maybe its worth another attempt because it is easier to debug from a small base.
One thing I have noticed in the past – using two article tags does not work, it throws the pagination off. You can only use one txp:article tag.
Also note that txp:older and txp:newer tags must be used in the page template after the call to the article, otherwise they won’t work.
Offline
#12 2009-04-23 09:16:39
- mark.adams82
- Member
- Registered: 2008-05-27
- Posts: 14
Re: Pagination Problem
Hi guys,
thank you all for all your help and suggestions. It strikes me that the problem is not with the code itself, but something perhaps more intricate within txp.
@ jstubbs – I have replaced the code in the section with the following:
<txp:if_section name=“news”>
<txp:article form=“article_news” limit=“2” />
<txp:ob1_pagination firsttext=“First page” previoustext=“Previous page” nexttext=“Next page” lasttext=“Last page” ulclass=“pagination” liselected=“active” />
<txp:older>LINK</txp:older>
</txp:if_section>
Very very simple! It still produces no link for either the ob1 pagination tags or the native txp:older tag. – As Els correctly points out earlier, there are 5 news articles, one of Type ‘Main’ and 4 of Type ‘Sub’, so there are further articles to be displayed. (Changing all articles to be the same ‘Type’ doesnt work, nor does removing this custom field altogether.
The code previously being used was compared to match exactly to a site where the pagination is working fine, yet it doesn’t on this one. This is what is leading me to think that the problem lies elsewhere. Either way I am completely stumped.
If anyone has any suggestions on how to look at this perhaps in a different light, I would be so so grateful.
Thanks again.
Ive just created a new test site with pagination working fine. Whats going on!?!?
Last edited by mark.adams82 (2009-04-23 09:48:42)
Offline