Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2015-05-22 09:48:26

laaaars
New Member
Registered: 2015-05-22
Posts: 7

link_to_next not working

Hi there,

I have come across about some problem that absolutely leaves me clueless. Hoping for help:

My page contains the following code fragments:

<txp:if_individual_article>
    <txp:article form="FULLARTICLE" />
    <a href="<txp:link_to_next />" class="more float_r" >NEXT</a>
    <a href="<txp:link_to_prev />" class="more float_l" >PREV</a> 
</txp:if_individual_article>

<txp:if_article_list>
    <txp:article form="POSTBOX" limit="20"/>
    <a href="<txp:older />" class="more float_r" >NEXT</a>
    <a href="<txp:newer />" class="more float_l" >PREV</a>
</txp:if_article_list>

The links to newer / older articles in the list work fine. However, the links to the prev/next full article don’t seem to pull any content into the html code (empty href=”“).
What may cause the problem? Any idea welcome.

Thanks,
Lars

Edited for presentation

Last edited by gaekwad (2015-05-22 13:40:12)

Offline

#2 2015-05-22 11:28:53

etc
Developer
Registered: 2010-11-11
Posts: 5,053
Website GitHub

Re: link_to_next not working

Hello Lars, welcome to the forum. There are two possible reasons:

  1. you use in some <txp:article /> some sort order clause that is identical for all articles, say, sort="Section";
  2. or all your articles have identical timestamps (weird, but…).

Offline

#3 2015-05-22 11:52:25

laaaars
New Member
Registered: 2015-05-22
Posts: 7

Re: link_to_next not working

Thanks for your kind reply.

Unfortunately, none of your two hints seem to apply. No sort attribute has been set in my code. And the time stamps (date of posted) are all different (at least no weird …)

Also <txp:next_title /> does not pull any content to the html.

Is there anything I need to adjust in my settings / preferences of textpattern?

Offline

#4 2015-05-22 12:58:59

etc
Developer
Registered: 2010-11-11
Posts: 5,053
Website GitHub

Re: link_to_next not working

Any hints in the page source if you put the site in debug mode? Also, what txp version are you using?

Offline

#5 2015-05-22 13:43:21

laaaars
New Member
Registered: 2015-05-22
Posts: 7

Re: link_to_next not working

I checked your hints:
No error messages appear when in debugging status.
So far my diagnostics show the following:

Textpattern version: 4.5.5 (r5575)
Last update: 2014-02-18 19:04:13/2014-02-24 19:21:50
Document root: /home1/laaaars/public_html
$path_to_site: /home1/laaaars/public_html
Textpattern path: /home1/laaaars/public_html/textpattern
Permanent link mode: section_title
Temporary directory path: /home1/laaaars/public_html/textpattern/tmp
Site URL: xxxxx.xx
PHP version: 5.4.38
GD Graphics Library: bundled (2.1.0 compatible); supported formats: GIF, JPG, PNG.
Server TZ: America/Chicago
Server local time: 2015-05-22 08:40:12
DST enabled?: 1
Automatically adjust DST setting?: 1
Time zone: Europe/Berlin (3600)
MySQL: 5.5.42-37.1
Locale: en_US.UTF-8
Server: Apache
PHP server API: cgi-fcgi
RFC 2616 headers: 0
Server OS: Linux 3.12.35.1418868451
Active plugins: zem_contact_reborn-4.0.3.20, rvm_maintenance-0.5, zem_contact_lang-4.0.3.6m, rsx_page_number, rsx_last_page_num, rsx_page_number_nav, rsx_pag-3.0.1, upm_insert_tab-0.3
Admin-side theme: remora 4.5.5

Pre-flight check: 
------------------------
New Textpattern CMS version 4.5.7 available for download.
------------------------

.htaccess file contents: 
------------------------
#DirectoryIndex index.php index.html

#Options +FollowSymLinks
#Options -Indexes
#ErrorDocument 403 default

<IfModule mod_rewrite.c>
	RewriteEngine On
	#RewriteBase /relative/web/path/
    RewriteBase /

	RewriteCond %{REQUEST_FILENAME} -f [OR]
	RewriteCond %{REQUEST_FILENAME} -d
	RewriteRule ^(.+) - [PT,L]

	RewriteCond %{REQUEST_URI} !=/favicon.ico
	RewriteRule ^(.*) index.php

	RewriteCond %{HTTP:Authorization}  !^$
	RewriteRule .* - [E=REMOTE_USER:%{HTTP:Authorization}]
</IfModule>

#php_value register_globals 0

# SVG
AddType image/svg+xml  svg svgz
AddEncoding gzip       svgz

------------------------

*************************************************************
*************************************************************

Is it somehow related to how url’s appear for individual articles?

Formatting edit

Last edited by gaekwad (2015-05-22 16:30:24)

Offline

#6 2015-05-22 14:03:59

laaaars
New Member
Registered: 2015-05-22
Posts: 7

Re: link_to_next not working

Maybe this hint helps:
When used as a container tag <txp:link_to_next>SOMETHING</txp:link_to_next>

nothing appears – not even the content SOMETHING.

Offline

#7 2015-05-22 14:12:17

etc
Developer
Registered: 2010-11-11
Posts: 5,053
Website GitHub

Re: link_to_next not working

laaaars wrote #290998:

Is it somehow related to how url’s appear for individual articles?

It could, but if <txp:next_title /> outputs nothing, there must be another reason. If you are sure you edit the right page form, we’ll need its full source, I’m afraid, probably FULLARTICLE form too. The fragment you have posted looks ok for me.

Edit: try <txp:link_to_next showalways="1">SOMETHING</txp:link_to_next>

Last edited by etc (2015-05-22 14:13:11)

Offline

#8 2015-05-22 14:14:52

laaaars
New Member
Registered: 2015-05-22
Posts: 7

Re: link_to_next not working

Well, here we go: Page source first

<!DOCTYPE html>
<html lang="de">

<head>
<txp:output_form form="HEAD" />
<link rel="stylesheet" href="<txp:css name="articles_css" />" type="text/css" media="screen" />
</head>

<body>
<div class="bground">
  <div id="wrapper" class="bground">
    <txp:output_form form="HEADER+NAV" />
    <txp:article form="MIDDLE" status="sticky" id="4" />
    <txp:output_form form="MAINARTICLE"/>
  </div> <!-- end wrapper -->
</div> <!-- end background -->
<txp:output_form form="FOOTER" />
</body>

</html>

Formatting edit

Last edited by gaekwad (2015-05-22 16:30:50)

Offline

#9 2015-05-22 14:18:44

etc
Developer
Registered: 2010-11-11
Posts: 5,053
Website GitHub

Re: link_to_next not working

Ah! This is suspect: <txp:article form="MIDDLE" status="sticky" id="4" />. Try to replace it with <txp:article_custom form="MIDDLE" status="sticky" id="4" />.

Offline

#10 2015-05-22 14:19:25

laaaars
New Member
Registered: 2015-05-22
Posts: 7

Re: link_to_next not working

Now essentially the (misc) form source:

<div id="main">

  <div class="myClass">

    <txp:if_individual_article>
      <txp:article form="ARTICLESIMPLE" sort="Posted" />
      <a href="<txp:link_to_next />" class="more float_r" >NEXTr</a>
      <a href="<txp:link_to_prev />" class="more float_l" >PREV</a>
      <txp:link_to_next>SOMETHING</txp:link_to_next>
    </txp:if_individual_article>

    <txp:if_article_list>
      <txp:article form="POSTBOX" limit="2"/>
        <a href="<txp:newer />" class="more float_l" >PREV</a>
        <txp:rsx_page_number_list delim="" />
        <a href="<txp:older />" class="more float_r" >NEXT</a>
    </txp:if_article_list>

  </div>

</div>

Moderator’s annotation:
Add Textile’s bc.. for readability reasons.
– Uli –

Last edited by uli (2015-05-22 14:47:57)

Offline

#11 2015-05-22 14:25:32

laaaars
New Member
Registered: 2015-05-22
Posts: 7

Re: link_to_next not working

Oh Yeah! You hit the mark.

Could you please explain in short why article instead of article_custom creates the trouble?

Thanks a lot my friend,
Lars

Offline

#12 2015-05-22 14:34:04

etc
Developer
Registered: 2010-11-11
Posts: 5,053
Website GitHub

Re: link_to_next not working

laaaars wrote #291005:

Oh Yeah! You hit the mark.

Could you please explain in short why article instead of article_custom creates the trouble?

Thanks a lot my friend,
Lars

In short, it’s the first <txp:article /> (not custom) that sets all pagination links. More than one <txp:article /> on a page is often source of trouble. Glad it helps, anyway.

Offline

Board footer

Powered by FluxBB