Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#76 2009-03-04 18:25:59

jsanto
Member
From: New York, NY
Registered: 2005-07-30
Posts: 19
Website

Re: rah_comments // Pagination for comments

Thanks for this excellent plugin.

FYI, made improvement appending an anchor (#comment) to page links. When used with appropriate placed “name” tag, this causes page links to jump to the comments, rather than the top of the article.

For example, this:

$number[] = doTag($i,'a','page-'.$i,' href="'.permlink(array()).$sep.'pg='.$i.'"');

becomes this:

$number[] = doTag($i,'a','page-'.$i,' href="'.permlink(array()).$sep.'pg='.$i.'#comment"');

Offline

#77 2009-10-19 13:35:50

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,367
Website GitHub Mastodon Twitter

Re: rah_comments // Pagination for comments

I’m helping some friends and I am trying to implement this plugin for their pages.

At the moment this is what they have a comments comment form to display the comments:

<h3 class="commenttitle"><txp:comment_name /> said,</h3>
<p class="commentmeta"><txp:comment_time /> <txp:comment_permlink>#</txp:comment_permlink></p>
<txp:comment_message />

Maybe I’m thinking about this all wrong as I never used the txp:comments tag.
What would the replacement code be so as to allow pagination of their comments?

Last edited by colak (2009-10-19 14:12:26)


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#78 2009-10-19 15:06:13

THE BLUE DRAGON
Member
From: Israel
Registered: 2007-11-16
Posts: 638
Website

Re: rah_comments // Pagination for comments

colak
the code you post here has nothing to do with this plugin
you just post here the comments style txp-form

you need to add the plugin code to the article-form that include the commenting-form

for example:

<txp:title />
<br /><txp:body />
<txp:if_comments_allowed>
<br />add a comment:
<txp:comments_preview form="comment_preview" />
<txp:comments_form form="comment_form" />
<txp:rah_comments form="comments" limit="10" />
</txp:if_comments_allowed>

Offline

#79 2009-10-19 16:25:13

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,367
Website GitHub Mastodon Twitter

Re: rah_comments // Pagination for comments

Thanks Gil,

Got it! One problem, even with the code above the comments still appear on the same page like so:

  • 1-30 page links
  • 1-10 comments
  • 1-30 page links
  • 1-600 comments

How do I get them to paginate?

Last edited by colak (2009-10-19 16:28:25)


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#80 2009-10-19 16:33:52

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

Re: rah_comments // Pagination for comments

colak wrote:

How do I get them to paginate?

By using the tag, <txp:rah_comments /> instead of the standard <txp:comments />. That’s it. There is nothing more to do or change.

If it doesn’t work, atleast post the code your using or tag trace. My 2cents; you’re probably just using auto-append, plus the code itself in article context. If you are using <txp:rah_comments />, or any other comment tag straight inside article form, please turn auto-appending off. That way you do not end up with double comment listing. Alternatively, use the code inside comment_display form.

It sounds that the plugin itself is working just fine. It outputs limited amount of comments and pagination links. And probably the pagination also works.

Last edited by Gocom (2009-10-19 16:40:59)

Offline

#81 2009-10-20 06:26:08

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,367
Website GitHub Mastodon Twitter

Re: rah_comments // Pagination for comments

Gocom wrote:

turn auto-appending off. That way you do not end up with double comment listing.

bingo , thanks Jukka!


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#82 2009-12-16 21:47:59

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

Re: rah_comments // Pagination for comments

Is there any chance of having an “active” class for the current page number link?


Stuart

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

#83 2010-03-01 09:31:46

roelof
Member
Registered: 2005-03-27
Posts: 647

Re: rah_comments // Pagination for comments

Hello Gocom,

I have a little problem.

Can I have all the comments in one class instead of every comment wrapped in a class ?

Roelof

Last edited by roelof (2010-03-01 09:34:51)

Offline

#84 2010-03-06 18:25:44

roelof
Member
Registered: 2005-03-27
Posts: 647

Re: rah_comments // Pagination for comments

Hello Gocom,

I still have one problem.
I have 18 comments total but <comments_count> gives 19.
So the pagination is 10 instead of 9.

Do you know why this happens ?

Roelof

Offline

#85 2010-07-18 22:34:41

jan
Member
From: Utrecht, The Netherlands
Registered: 2006-08-31
Posts: 71
Website

Re: rah_comments // Pagination for comments

Hey,

Plugin was just what I needed, comments were breaking out of my design!

I have one suggestion: adding an attribute to control wheter or not the current page number is displayed as a link or as plain text.
It’s usually more helpful to display the current page as plain text, since it gives the user a direct indication of current page.

It requires two extra lines of code:

Extra attribute (put in below line 32)

'link_to_current' => 0,

Extra if clause to output either plaint text or link (replace line 50 with this longer version)

$number[] = (($link_to_current && $pg == $i) || $pg != $i) ? doTag($i,'a','page-'.$i,' href="'.permlink(array()).$sep.'pg='.$i.'"') : $i;

Cheers!


Kensington TXP powered rock

Offline

#86 2010-07-18 23:38:28

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

Re: rah_comments // Pagination for comments

Thank you for sharing, Jan :-)

Offline

#87 2010-09-07 07:55:52

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,367
Website GitHub Mastodon Twitter

Re: rah_comments // Pagination for comments

is there a way to NOT have the pagination links when there is just one page of comments?

ps. Jukka, you may want to update the original post so as to state the latest 0.4 version of the plugin.

Last edited by colak (2010-09-07 08:18:25)


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#88 2010-09-07 10:16:33

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

Re: rah_comments // Pagination for comments

colak wrote:

ps. Jukka, you may want to update the original post so as to state the latest 0.4 version of the plugin.

Thanks, Yiannis. Done.

is there a way to NOT have the pagination links when there is just one page of comments?

Is. From the docs:

showalways
Always show page number links, even if there is only a one page.
Default: showalways="1" (yes) Example: "" (no).

Following should work:

<txp:rah_comments showalways="0" />

Last edited by Gocom (2010-09-07 10:17:05)

Offline

#89 2010-09-07 10:20:31

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,367
Website GitHub Mastodon Twitter

Re: rah_comments // Pagination for comments

Gocom wrote:

From the docs:

I’m blind as a bat! Thanks Jukka


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#90 2011-02-16 22:54:39

milosevic
Member
From: Madrid, Spain
Registered: 2005-09-19
Posts: 390

Re: rah_comments // Pagination for comments

Hello:

first of all, nice plugin! but I can’t use because it don’t recognizes de URL of my comments article page. It is not a error or bug, I explain:

At one site I’m spliting de article page in to different “pages”:

mysite.com/myarticle : an article wich shows its title, excerp, body… and only the 3 recent comments posted on the article.
mysite.com/myarticle?x=comments : with this param, the page show only the complete comments list on the article.

I want to use rah_comments in the comments version of the article page mysute.com/myarticle?x=comments, but the pagination bottons generated by rah_comments links allways to mysite.com/myarticle?pg=2 (3,4…) so I suposse it assumes that it is allways used on the normal article page (and it is a normal behavior, but fails in my case) Maybe if the plugin do not asumes where is it used and looked to the actual URL of the page, everythink will runs ok.

I know it is a nos usual use of comments, but I think that improve de plugin at this point will make it powerfull and don’t becomes it more complicated to the user.

Another improvement will be set de page 1 link go to “current page” (now articles permlink) without “?pg=1”. because it create duplicated content: two URLs serving de same information.

Last edited by milosevic (2011-02-16 23:10:04)


<txp:rocks/>

Offline

Board footer

Powered by FluxBB