Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#16 2009-09-29 15:38:26

KaiBo
New Member
Registered: 2009-09-16
Posts: 1

Re: txp:article_custom and pagination

I tackle with this behavior as well. Any workarounds mentioned here or found elsewhere sadly will not work for me (displaying specific categories in a different section). Having looked into the Sourcecode this behavior seems to be intended:

//do not paginate if we are on a custom list
if (!$iscustom and !$issticky)

article_custom is internally treated like a single article in more than one place. Hence Pagination seems to have been “disabled”. Anybody knows the deeper reason for this?

Offline

#17 2013-01-28 10:01:46

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

Re: txp:article_custom and pagination

It would be nice (for pagination plugins authors) if article_custom minimally supported pgonly attribute, just returning the number of pages, without setting pagination data. Is it feasible?

Offline

#18 2013-04-14 00:25:03

madzzoni
Member
From: Grünberg/Hessen/DE
Registered: 2013-01-22
Posts: 38

Re: txp:article_custom and pagination

Hello. I would like to use the “default pagination” from the TXP 4.5.4 theme in my News-page, which shows a list of 5 article excerpts from Articles-section (and there is 8 in total) – but the pagination doesn’t seems to work with the “article_custom” txp-tag, or others than the <txp:if_individual_article> tag!

My code:

<div>
        <txp:article_custom excerpted="1" form="static_headline" section="articles" limit="5" />
</div>
        <p id="paginator">
                 <txp:if_article_custom>
                           <txp:variable name="prev" value='<txp:link_to_prev />' />
          <txp:variable name="next" value='<txp:link_to_next />' />
          <txp:if_variable name="prev" value="">
            <span id="paginator-l" class="button disabled">← <txp:text item="older" /></span>
          <txp:else />
            <a id="paginator-l" href="<txp:link_to_prev />" title="<txp:prev_title />" class="button">← <txp:text item="older" /></a>
          </txp:if_variable>
          <txp:if_variable name="next" value="">
            <span id="paginator-r" class="button disabled"><txp:text item="newer" /> →</span>
          <txp:else />
            <a id="paginator-r" href="<txp:link_to_next />" title="<txp:next_title />" class="button"><txp:text item="newer" /> →</a>
          </txp:if_variable>
         <txp:else />
          <txp:variable name="prev" value='<txp:older />' />
          <txp:variable name="next" value='<txp:newer />' />
          <txp:if_variable name="prev" value="">
            <span id="paginator-l" class="button disabled">← <txp:text item="older" /></span>
          <txp:else />
            <a id="paginator-l" href="<txp:older />" title="<txp:text item='older' />" class="button">← <txp:text item="older" /></a>
          </txp:if_variable>
          <txp:if_variable name="next" value="">
            <span id="paginator-r" class="button disabled"><txp:text item="newer" /> →</span>
          <txp:else />
            <a id="paginator-r" href="<txp:newer />" title="<txp:text item='newer' />" class="button"><txp:text item="newer" /> →</a>
          </txp:if_variable>
    </txp:if_article_custom>

Which txp-tag do i have to use to get the pagination active here??

Best regards,

madzzoni


<TXP:n00b />

Offline

#19 2013-04-14 00:53:44

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,319

Re: txp:article_custom and pagination

There’s no such tag as if_article_custom.


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#20 2013-04-14 01:05:30

madzzoni
Member
From: Grünberg/Hessen/DE
Registered: 2013-01-22
Posts: 38

Re: txp:article_custom and pagination

Aha, – thx mate ;-) – and the <txp:if_individual_article> doesn’t work here … so any other suggestions perhaps?


<TXP:n00b />

Offline

#21 2013-04-14 19:25:08

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,319

Re: txp:article_custom and pagination

madzzoni wrote:

and the <txp:if_individual_article> doesn’t work here

No, correct, article_custom creates only article lists, even if restricted to output just one article.

If you need an article_custom tag, there are several solutions for a pagination: 3 here, another one here, one more here, and possibly further ones on TXPTips.


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#22 2013-04-15 00:03:45

madzzoni
Member
From: Grünberg/Hessen/DE
Registered: 2013-01-22
Posts: 38

Re: txp:article_custom and pagination

Thanks uli, and yes i know about these plugin solutions you mention, – but they aren’t optimal for me, – i only need the previous/next page option, as in the default theme and just hoped for some kind of txp:tag workaround i 4.5.4.
I already tried the etc_pagination-plugin, but it doesn’t work in my page/setup.

We can hope for a native pagination system for if_article_custom pages too in the next TXP release ;-)


<TXP:n00b />

Offline

#23 2013-04-15 07:56:35

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

Re: txp:article_custom and pagination

madzzoni wrote:

I already tried the etc_pagination-plugin, but it doesn’t work in my page/setup.

If it doesn’t, it will. :) Have you tried this:

<txp:etc_pagination pages='<txp:etc_numpages excerpted="1" section="articles" pageby="5" />'
	range="1" prev="Prev" next="Next" pgcounter="page" wraptag="nav" />

This will give you few page links, where you can hide (with css) everything except a[rel="prev"] and a[rel="next"]:

<style>nav a {display:none} nav a[rel="prev"], nav a [rel="next"] {display:inline}</style>

To output the correct page (given by page url parameter), use

<txp:article_custom excerpted="1" form="static_headline" section="articles" limit="5" offset='<txp:etc_offset pgcounter="page" />' />

Link to prev/next article is another story. You can do it all with etc_query, but this will require some learning.

There is no natural way to paginate <txp:article_custom />’s, because they can be many on the page, and it is not clear which list must be concerned by <txp:older/newer /> tags.

Offline

#24 2013-04-15 22:12:38

madzzoni
Member
From: Grünberg/Hessen/DE
Registered: 2013-01-22
Posts: 38

Re: txp:article_custom and pagination

Thanks etc :-) … I’ll try this option.


<TXP:n00b />

Offline

Board footer

Powered by FluxBB