Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2013-12-27 03:31:40

Maurice
Member
From: Auckland, New Zealand.
Registered: 2010-12-02
Posts: 25
Website

[solved] (error) Link to previous or next if individual article.

I’m having problems with my link to prev link to next article when listed individually. It’s only showing the link to previous but doesn’t link to previous it links to the first article. I’m also receiving the ‘Undefined index’ notice when debugging.

Problem is demonstrated here

I do remember having this working but somethings gone wrong during development.. but what? Any help greatly appreciated.

Using Textpattern 4.5.5

For my archive page I have this similar to default Textpattern install:

<div class="wrapper">
<div class="container">
<main role="main" aria-label="Main content">
<txp:if_article_list>
<section role="region" itemscope itemtype="http://schema.org/CollectionPage">
<h1 itemprop="name"><txp:article status="sticky" /></h1>                        
<div itemprop="mainContentOfPage">
<txp:article listform="article_listing" limit="3" wraptag="ul" class="article-list" />                            
</div>
</section>
<txp:else />
<txp:article form="portfolio"/>
</txp:if_article_list>               
<txp:if_individual_article>
<txp:variable name="more" value='<txp:link_to_prev /><txp:link_to_next />' />
<txp:variable name="prev" value='<txp:link_to_prev />' />
<txp:variable name="next" value='<txp:link_to_next />' />
<txp:if_variable name="more" value="">
<txp:else />
<p class="paginator">
<txp:if_variable name="prev" value="">
<txp:else />
<a rel="prev" href="<txp:link_to_prev />" title="<txp:prev_title />">← <txp:text item="older" /></a>
</txp:if_variable>
<txp:if_variable name="next" value="">
<txp:else />
<a rel="next" href="<txp:link_to_next />" title="<txp:next_title />"><txp:text item="newer" /> →</a>
</txp:if_variable>
</p>
</txp:if_variable>
<txp:else />
<txp:variable name="more" value='<txp:older /><txp:newer />' />
<txp:variable name="prev" value='<txp:older />' />
<txp:variable name="next" value='<txp:newer />' />
<txp:if_variable name="more" value="">
<txp:else />
<p class="paginator">
<txp:if_variable name="prev" value="">
<txp:else />
<a rel="prev" href="<txp:older />" title="<txp:text item="older" />">← <txp:text item="older" /></a>
</txp:if_variable>
<txp:if_variable name="next" value="">
<txp:else />
<a rel="next" href="<txp:newer />" title="<txp:text item="newer" />"><txp:text item="newer" /> →</a>
</txp:if_variable>
</p>
</txp:if_variable>
</txp:if_individual_article>
</main> 
</div> <!-- /.container -->
</div> <!-- /.wrapper -->

For my individual article form ‘portfolio’ I have this:

<div class="portfolio">
<article role="article" itemscope itemtype="http://schema.org/WebPage">
<h1 itemprop="name"><txp:title /></h1>
<div class="layout--span-1-8">
<txp:if_article_image>
<div class="rslides-container">
<ul class="rslides">
<txp:hak_article_image form="article_image" />
</ul>
</div>
</txp:if_article_image>
</div>   
<div class="layout--span-9-12">
<txp:body />
</div>
</article>
</div>

For the debugging I get this:

Tag error: <txp:link_to_prev /> ->  Notice: Undefined index: posted while parsing form None on page archive
textpattern/publish/taghandlers.php:1444 getNextPrev()
textpattern/lib/txplib_publish.php:426 link_to_prev()
textpattern/lib/txplib_publish.php:326 processTags()
textpattern/lib/txplib_misc.php:1264 parse()
textpattern/lib/txplib_publish.php:426 splat()
textpattern/lib/txplib_publish.php:326 processTags()
textpattern/publish/taghandlers.php:3313 parse()
textpattern/lib/txplib_publish.php:426 if_individual_article()
textpattern/lib/txplib_publish.php:339 processTags()
textpattern/publish.php:544 parse()

and this:

Tag error: <txp:link_to_prev /> ->  Notice: Undefined index:  while parsing form None on page archive
textpattern/publish/taghandlers.php:1444 getNextPrev()
textpattern/lib/txplib_publish.php:426 link_to_prev()
textpattern/lib/txplib_publish.php:326 processTags()
textpattern/lib/txplib_misc.php:1264 parse()
textpattern/lib/txplib_publish.php:426 splat()
textpattern/lib/txplib_publish.php:326 processTags()
textpattern/publish/taghandlers.php:3313 parse()
textpattern/lib/txplib_publish.php:426 if_individual_article()
textpattern/lib/txplib_publish.php:339 processTags()
textpattern/publish.php:544 parse()

{Edited to label topic as solved. – Uli}

Last edited by uli (2014-01-08 13:45:24)


<txp:carver category="stone" type="hard"> These bits are harder than Basalt </txp:carver>

Offline

#2 2013-12-27 13:40:58

GugUser
Member
From: Quito (Ecuador)
Registered: 2007-12-16
Posts: 1,473

Re: [solved] (error) Link to previous or next if individual article.

Does this change if you put a limit="1" as the following?

<txp:article limit="1" form="portfolio" />

Offline

#3 2013-12-27 15:41:15

gaekwad
Server grease monkey
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 4,137
GitHub

Re: [solved] (error) Link to previous or next if individual article.

Can you post diagnostics? I’ve had Notice: Undefined index before with an outdated plugin.

Offline

#4 2013-12-27 16:00:08

GugUser
Member
From: Quito (Ecuador)
Registered: 2007-12-16
Posts: 1,473

Re: [solved] (error) Link to previous or next if individual article.

With respect to an outdated plugin: Why you use the hak_article_image plugin? I think this isn’t necessary, you can do it with txp:images.

Offline

#5 2013-12-27 17:07:45

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: [solved] (error) Link to previous or next if individual article.

Post your full tag trace from the problem page. Will let us see the actual inner workings, allowing us to offer help that isn’t possible from a snippet without context.

That said, there is a bug in pagination calculation on 4.5.5. article_custom tag can trample the filters used for sorting. But it might be totally unrelated.

There might also be paging issue in your templates. If I remember correctly even sticky tag will set the paging. If so:

<txp:article status="sticky" />
<txp:article listform="article_listing" limit="3" wraptag="ul" class="article-list" /> 

This would give wrong results. You would have to set pageby="3" in the first article tag.

gaekwad wrote #277582:

Can you post diagnostics? I’ve had Notice: Undefined index before with an outdated plugin.

The error does originate form a core tag, tho.

Offline

#6 2013-12-28 00:25:36

Maurice
Member
From: Auckland, New Zealand.
Registered: 2010-12-02
Posts: 25
Website

Re: [solved] (error) Link to previous or next if individual article.

Gocom wrote #277584:

If I remember correctly even sticky tag will set the paging.

Solved! Thanks, back tracking I then remembered I had added meta descriptions in the head of the page using article tags. Great to have some other sets of eyes on it, tag trace certainly helped!

pageby="integer"

The number of articles to jump forward or back when an older or newer link is clicked. Allows you to call the article tag several times on a page without messing up older/newer links.

Default: value matches the value assigned to limit.

‘messing up’ is a good way of describing it.

Last edited by Maurice (2013-12-28 00:52:34)


<txp:carver category="stone" type="hard"> These bits are harder than Basalt </txp:carver>

Offline

Board footer

Powered by FluxBB