My favorites | Sign in
Project Home Downloads Wiki Source
Search
for
Pageless  
Give your blog the ability of Infinite scrolling, instead of breaking content into 'pages.'
Habari, Plugin
Updated Mar 5, 2011 by elo...@gmail.com

Caution

You must have basic HTML and PHP knowledge to use this plugin.

Introduction

This plugin give your blog the ability of Infinite scrolling, instead of breaking content into ‘pages.’

Installation

  1. Extract the file.
  2. Put the folder pageless to /user/plugins and activate it.
  3. Copy pageless.php from pageless folder the activated theme folder and modify it base on the theme (Mostly you can simply copy mutiple.php in the activated theme folder and remove all lines before or after the foreach block).

Configuration & Customization

After activated it, click Configure button to setup the plugin. All of following options are required and have to be set properly.

  • How many posts to load each time?

Modify Your Theme

This plugin need theme to conform following conditions

  1. Each post need to have a ID. ID format is {$content_type}-{$post_slug}.
  2. There should be a CSS class apply on every posts.
  3. Page selector must have a ID.
  4. Theme must have a filter named filter_pageless_options to specify what it the CSS class in 2 and what is the ID in 3.

Example

Given this HTML structure.

<div id="entry-hello-world" class="hentry">
	<!-- Post 1 -->
</div>
<div id="entry-goodbye-world" class="hentry">
	<!-- Post 2 -->
</div>
<div id="entry-hello-world-again" class="hentry">
	<!-- Post 3 -->
</div>
<div id="page-selector">
	<!-- Page: 1, 2, 3, ... -->
</div>
  1. Each post’s container must have an ID named {$content_type}-{$post_slug}. If an entry’s slug is hello-world, then its ID should be entry-hello-world.
  2. Every post must have an identical CSS class. In this example, it is “hentry”, and this CSS class must not appear elsewhere.
  3. The page selector’s container must have an ID. In this example, it is “page-selector”.

Now we know the CSS class for posts and the ID for page selector. We can add filter_pageless_options in theme.php to record this.

public function filter_pageless_options( $options )
{
	$options[ 'post_class' ] = 'hentry';
	$options[ 'pager_id' ] = 'pager';
	return $options;
}

Download

Changelog

  • 0.6-0.1 (2008-07-31) – Initial release.
  • 0.6-0.2 (2009-03-04) – Some bug fixes and add translations.
  • 0.7-0.2.1 (2010-02-23) – Make compatible with Habari 0.7
  • 0.7-0.3 (2011-03-05) – Apply new method of setting options.

Sign in to add a comment
Powered by Google Project Hosting