Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
prev & next navigation weirdness
Hi. I’ve been battling with this for a few hours and I’m stumped. I have a feeling it’s something derpy I’m doing wrong, but I need to step away before I punch a fist through my screen. Yes, it’s been that kind of morning :)
OK, this relates to my blog, here — it is work safe, no swearing. At the present time, these are the twelve most recent posts (descending order, chronological – output by article_custom
in the footer and article
in the main page, nothing fancy):
- Cryptic much
- Delivering fuel and design changes
- Old school
- Friday, so far
- Millionaires row, Cornwall
- It’s Thursday, yo
- Today is Wednesday and it’s going to be a good one
- Hello, unknown person from near Birmingham on BT Broadband
- Getting my houses in order
- So much that I can’t say + soup
- Suggestions, please
- Yesterday was bumpy, today is OK
My understanding is that a given article with the following code in the article form should display a hyperlink to the previous and next articles where they exist:
<txp:if_individual_article>
<div class="pagination pagination-centered">
<ul>
<li><txp:link_to_prev>← <txp:prev_title /></txp:link_to_prev></li>
<li><txp:link_to_next><txp:next_title /> →</txp:link_to_next></li>
</ul>
</div><!-- pagination pagination-centered -->
</txp:if_individual_article>
So, article #2 above should have a link to #3 and #1, article #3 should have a link to #4 and #2, and so forth. Sadly, this isn’t the case. Here’s the deal:
- Links to itself
- Links to itself and #1
- Links to itself and #2
- Links to #3 and #2
- Links to itself and #4
- Links to #5 and #4
- Links to #7 and #6
- Links to itself and #6
- Links to itself and #8
- Links to itself and #9
- Links to itself and #11
- Links to #11 and #10
Huh. What the eff?
Debugging mode is on. I’ve styled prev
links with a ←
and next
links with a →
if that helps. I am completely out of ideas on this one.
Thank you in advance for any pointers.
Edit: clarified use of article_custom
and article
.
Last edited by gaekwad (2012-09-18 15:49:42)
Offline
Re: prev & next navigation weirdness
Why are you using <txp:article_custom />
? <txp:link_to_prev>
and <txp:link_to_next>
are retrieved from <txp:article />
, so the result with <txp:article_custom />
is unpredictable.
Offline
Re: prev & next navigation weirdness
etc wrote:
Why are you using
<txp:article_custom />
?<txp:link_to_prev>
and<txp:link_to_next>
are retrieved from<txp:article />
, so the result with<txp:article_custom />
is unpredictable.
Hi Oleg.
I am using article_custom
in this context inside the footer (‘Recent posts’) links:
<txp:article_custom form="article_list_recent_posts" limit="12" section="blog" />
…because article
doesn’t allow section
as a parameter. The default sort order for article
is Posted desc
, and the default sort order for article_custom
is also Posted desc
, so there should be no difference, right?
Last edited by gaekwad (2012-09-15 14:09:17)
Offline
Re: prev & next navigation weirdness
gaekwad wrote:
The default sort order for
article
isPosted desc
, and the default sort order forarticle_custom
is alsoPosted desc
, so there should be no difference, right?
Right, unless you use something like <txp:article limit="0" />
, but it’s still weird. Anyway, <txp:article />
is context-sensitive, so in your blog
section you don’t need section
attribute?
Offline
Re: prev & next navigation weirdness
etc wrote:
Anyway,
<txp:article />
is context-sensitive, so in yourblog
section you don’t needsection
attribute?
Hi Oleg.
Thank you for your time with this. I’m using this to output the articles in /blog:
<txp:article limit="15" />
The article_custom
is only used in the site footer, and that’s global. The article
output order above is identical to the article_custom
output in the footer.
Offline
Re: prev & next navigation weirdness
Very weird, indeed. Pete, is there another <txp:article />
on the page, or some plugins?
Edit: just discovered I have the same issue on localhost site under txp 4.5.0, but not and also under 4.5.1. But not on other sites.
Last edited by etc (2012-09-15 15:15:58)
Offline
Re: prev & next navigation weirdness
etc wrote:
just discovered I have the same issue on localhost site under txp 4.5.0,
but notand also under 4.5.1. But not on other sites.
Hi Oleg.
Well, I’m glad it’s not just me being stupid — thank you for testing it. I will build a localhost 4.5.1 and try to reproduce the steps to file a bug report (if appropriate).
Edit: I wonder, Oleg, are your localhost sites and other sites on the same timezone settings? I ask because I’ve just replicated my site to a localhost (petecooper.org.dev – screenshots to follow) and it’s behaving as expected (that is, prev/next article nav works). I will continue to probe and see what I can find. The only difference I know about on localhost is timezone — my remote sites are PDT, localhost is GMT, both have DST enabled.
Last edited by gaekwad (2012-09-15 15:26:02)
Offline
Re: prev & next navigation weirdness
Interesting findings coming up…
Two screenshots — localhost and remote server of the same page/article. Identical database — exported from the remote server and replaced the localhost version with the fresh export. Timezones are the same in the Textpattern admin, though system times are GMT and PDT for localhost and remote server respectively.
The localhost behaves as expected, the remote doesn’t.
Last edited by gaekwad (2012-09-15 15:37:12)
Offline
Re: prev & next navigation weirdness
Bumping remote site to 4.5.1 to see if that helps things.
Edit: no, same thing.
Last edited by gaekwad (2012-09-15 16:06:04)
Offline
Re: prev & next navigation weirdness
My local and remote have different os, php, mysql and apache versions, different settings too, so I do not know whom to suspect first. I have tried enabling/disabling DST, without any result.
Edit: another site on localhost runs fine under 4.4.1
Last edited by etc (2012-09-15 16:12:21)
Offline
Re: prev & next navigation weirdness
etc wrote:
another site on localhost runs fine under 4.4.1
Thanks, Oleg. I will do some localhost clean installs (4.4.1, 4.5.0, 4.5.1) and try to diagnose the problem.
Offline
Re: prev & next navigation weirdness
Is there a chance that the web server and the mysql server are in different timezones?
Offline