Rah comments - Paginated article comments list for Textpattern CMS

Overview

rah_comments

Download | Packagist | Issues | Support forum | Donate

Rah_comments lets you to paginate Textpattern CMS’ comment lists, splitting the long endless list of comments into multiple pages with fully customisable navigation.

The plugin is a module for etc_pagination, extending the core comment system and letting etc_pagination to work with it. Rah_comments does the background work such as URL routing and comment calculation, while etc_pagination takes care of rendering the pagination.

Install

Using Composer:

$ composer require rah/rah_comments:*

Or download a plugin package.

Requirements

Basics

Rah_comments is used together with etc_pagination to generate pagination for article comments, and comes with few tags that make core comment system and etc_pagination fully compatible.

All-in-all, rah_comments takes care of providing etc_pagination page count it uses to figure out what it needs to render, rewrites and reroutes comment URLs and smoothens the comment submissions process.

Two tags are included; rah_comments_numpages – the main that which acts as the etc_pagination glue and rah_comment_permlink, a replacement tag for comment_permlink.

The most basic usage case would involve calculating the number of pages using rah_comments, passing the value to etc_pagination and then using the core comments tag with a correct offset attribute passed to it:

<txp:variable name="numPages" value='<txp:rah_comments_numpages limit="10" />' />
<txp:etc_pagination pages='<txp:variable name="numPages" />' />
<txp:comments offset='<txp:etc_offset pageby="10" />' limit="10" />

The above is similar to any etc_pagination use case, but instead of using it’s etc_numpages, we’re using rah_comments_numpages.

Tags and attributes

rah_comments_numpages

<txp:rah_comments_numpages limit="10" />

Calculates and returns the number of comment pages, while doing some necessary background tasks. The number of pages is calculated based on the provided offset and limit attributes, and the resulting value should be passed to etc_pagination or similar pagination generator.

To the pagination to work properly, the tag needs that two attributes, limit and sort, are identically mirrored to match the values used in the paginated comments tag.

Attributes

limit
Number of comments displayed per page. This value should be identical to the limit you are using on the comments tag.
Default: "10" Example: limit="5"

sort
Comment sorting criteria. This value should be identical to the sort attribute you are using on the comments tag, if you are using any.
Default: "posted asc" Example: sort="posted desc"

offset
Number of comments skipped.
Default: "0" Example: offset="5"

parameter
The query string parameter the page number is passed in. This value should be set to match the parameter, pg_counter, you are using with etc_pagination.
Default: "pg" Example: parameter="pg"

rah_comment_permlink

<txp:rah_comment_permlink>
    ...contained statement...
</txp:rah_comment_permlink>

Renders comment permlink, used as comment_permlink tag’s replacement.

Attributes

anchor
Whether to apply the comment’s id to the hyperlink tag (as the id attribute), setting this comment permanent link as the comment page anchor.
Default: "1" Example: anchor="0"

Examples

Basic pagination

<txp:variable name="numPages" value='<txp:rah_comments_numpages limit="10" />' />
<txp:etc_pagination pages='<txp:variable name="numPages" />' />
<txp:comments offset='<txp:etc_offset pageby="10" />' limit="10" />

The above renders 10 comments per page and displays page numbers above the comment list.

Recent comments

<txp:recent_comments limit="10" wraptag="ul" break="li">
    <txp:rah_comment_permlink><txp:comment_name link="0" /> (<txp:title />)</txp:rah_comment_permlink>
</txp:recent_comments>

The above renders last 10 comments on the website.

Changelog

Version 0.5.0 – upcoming

  • Rewritten as etc_pagination module.
  • Removed: rah_comments tag.
  • Removed: rah_recent_comments tag.
  • Added: rah_comments_numpages tag.
  • Added: rah_comment_permlink tag.
  • Updated: now shows the correct comment page after new comment submissions.
  • Performance optimisations.
  • Released as Composer package.

Version 0.4 – 2008/09/14

  • Added <txp:rah_recent_comments /> tag.

Version 0.3 – 2008/09/03

  • Removed attributes: break_nav and break_pages.
  • Fixed messy url mode’s error: now works fully on messy.
  • Added attributes: pg_break, pg_break_class, prepend and append.
  • Now works in article lists, same way like <txp:comments />.
  • Better documentation.

Version 0.2 – 2008/02/17

  • Some minor bug fixes.
  • Removed some typos from documentation.

Version 0.1 – 2008/02/16

  • First release.
You might also like...
Textpattern-installer - Textpattern plugin and theme installer for Composer

Textpattern Installer for Composer Package directory | Issues Install plugins and themes to Textpattern CMS with Composer. $ composer require rah/rah_

SliceColumns is a REDAXO AddOn. Grid arrangement for REDAXO article slices.
SliceColumns is a REDAXO AddOn. Grid arrangement for REDAXO article slices.

REDAXO-AddOn: SliceColumns Das REDAXO-AddOn erlaubt die Anordnung der Slices in Spalten und das Verschieben von Blöcken per Drag & Drop. Screenshot mi

An article about alternative solution for convert object into a JSON Object for your api.

Do we really need a serializer for our JSON API? The last years I did build a lot of JSON APIs but personally was never happy about the magic of using

MassPlugCompiler - Textpattern CMS plugin compiler

mtxpc mtxpc compiles Textpattern CMS plugin sources into installer packages. Supports multi-file structure and a JSON manifest file. Install Using Com

Ied plugin composer - Inspired Plugin Composer: Create, publish and edit plugins from within Textpattern CMS.

ied_plugin_composer Create, publish and edit plugins from within Textpattern CMS. Creates a new page under the Extensions tab where you can edit and e

Etc cache - Cache plugin for Textpattern CMS

etc_cache Download | Packagist This Textpattern plugin provides an events-driven cache solution for Textpattern CMS. Textpattern is fast, but when you

Etc pagination - Pagination plugin for Textpattern CMS.

etc_pagination Download | Packagist This Textpattern plugin creates a paginated navigation bar on listings. It has a wide variety of attributes – so y

Smd imagery - A Textpattern CMS plugin for managing images in the Write panel.

smd_imagery Insert images into your Write panel. Very handy for people who run photoblog or image-heavy sites, or those who categorise images for incl

Zem contact reborn - An extensible HTML form mailer plugin for Textpattern CMS.

com_connect Contents Introduction Installing and upgrading Migrating from zem_contact_reborn Usage Tags com_connect tag com_connect_text tag com_conne

Releases(0.4)
Owner
Jukka Svahn
Backend developer by trade, hobbyist designer and frontend fiddler, self-proclaimed home cook and baker
Jukka Svahn
Rah backup - Takes backups from Textpattern CMS installations

rah_backup Packagist | Twitter | Donate Rah_backup keeps your important site safe from disastrous events. Rah_backup is an admin-side backup utility p

Jukka Svahn 5 Apr 24, 2022
Rah sitemap - XML sitemap generator for Textpattern CMS

rah_sitemap Packagist | Issues | Donate Sitemap plugin for Textpattern CMS. Generates Sitemaps.org XML sitemaps for your site, which help Google and o

Jukka Svahn 7 May 13, 2022
Rah memcached - Store parts of Textpattern CMS templates in Memcached

rah_memcached Packagist | Issues | Donate A plugin for Textpattern CMS that stores parts of your templates in Memcached, a distributed in-memory key-v

Jukka Svahn 2 Aug 12, 2022
Rah comment spam - Comment anti-spam plugin for Textpattern CMS

rah_comment_spam Packagist | Issues | Donate Rah_comment_spam provides customizable anti-spam tools for Textpattern CMS’ comment system. Set minimum a

Jukka Svahn 2 Apr 24, 2022
Rah privileges - Configure Textpattern CMS' user-group privileges through Preferences panel

rah_privileges Packagist | Donate Configure admin-side user-group permissions from Textpattern CMS’ preferences panel. Install Using Composer: $ compo

Jukka Svahn 4 Apr 16, 2022
Rah cache - Cache Textpattern's dynamic pages as flat files

rah_cache Packagist | Issues Rah_cache is a simple, experimental full-page caching plugin for Textpattern CMS. It caches Texpattern’s dynamic pages as

Jukka Svahn 2 Apr 24, 2022
Smd horizon - Next/previous Textpattern article without restrictions

smd_horizon The existing tags <txp:next_title />, <txp:link_to_next /> and their prev counterparts cease to function when they reach the first/last po

Stef Dawson 1 Oct 22, 2019
Yab copy to new - A Textpattern plugin. Copies the current article content to a new one.

yab_copy_to_new Displays a new button in article write tab to copy the current article to a new one. Version: 0.2 Table of contents Plugin requirement

Tommy Schmucker 2 Dec 15, 2017
Textpattern-for-Panic-Coda - A Textpattern CMS mode for Panic Coda

Textpattern elements for Panic Coda 2 Handy elements for use with Panic Coda 2 on a Mac when authoring files for the Textpattern CMS. This repository

Phil Wareham 8 Jun 26, 2017