Summary: Breaks pages into sections with inserted markers and displays one section at a time
Status: Stable
Version: 2004-10-20(breakpage.php, 2006-10-28(breakpage2.php), 2005-08-18(break_page.php)
Prerequisites: pmwiki-2.1
Maintainer: jr
Discussion: BreakPage-Talk
Categories: CMS
Download: breakpage.phpΔ

breakpage2.phpΔ (for CommentBoxPlus) break_page.phpΔ (with editable sections) break_page55.phpΔ (for PHP 5.5)

Questions answered by this recipe

How can I break long pages into smaller page chunks which can be sequentially displayed as 1, 2, 3, ...


By installing breakpage.phpΔ you can add section break markers (:breakpage:) onto a page, which the recipe will use to break the page into sections and display one at a time, with links to the others. It does not add edit links to edit each section separately, as break_page.phpΔ does.

  • breakpage.phpΔ -- the original recipe script. It uses (:breakpage:) directive as markers. Works with pmwiki 2.1.
  • breakpage2.phpΔ -- Modified for use with CommentBoxPlus using markers (:comment breakpage:) to result in invisible markers even if page breaks are disabled.
  • break_page.phpΔ -- Alternative -- adds the following features:
    • work with beta 44 and above (further testing still required -- this is a major change)
    • change the (:breakpage:) directive to ____ (4 underscores)
    • add action=editpage which lets you edit the current chunk via a link at the top of the page
    • add a tool tip to the page numbers to show the first paragraph of the page

Release Notes break_page.phpΔ

  • 2017-03-24: fix scriptΔ for PHP 5.5.
  • 2005-08-01: fix break_page to work with new edit page features.
  • 2004-11-29: minor bug fix 29 Nov 2004 to add newlines around the chunk being posted
  • 2004-11-07: original release of break_page.phpΔ jr

Current status (jr 18 Aug 2004):

  • break_page (the 4 underscores version) works with beta 53; PmWiki introduced an $EnablePost variable and set it to true, thereby causing a break_page edit request to post the chunk being edited, throwing away the rest of the page (ouch!)
  • it uses a $PageEditFmt variable, rather than the edit form; the variable includes a summary text box, but not a Save and Edit button; fixing the problem described above seemed more important
  • the plan is first to add a Save and Edit button to the $PageEditFmt variable, then investigate how to use a form variable to hold the editing components, then possibly merge all the different versions into one configurable recipe

Alternative: break-page.phpΔ

This script uses section break markers of form ==== to create editable page sections, but does not display only one section at a time. In addition optionally headers can be used to form automatic editable sections on the page.

Important: Klonk has forked SectionEdit from this script. It is recommended that you switch from break-page to SectionEdit. Though you will get support for break-page all current development resources are going into SectionEdit.

Should this go in the Superseded section? - Martin Fick

Changes from the break_page.php script: break-page.phpΔ

  • seperates the page in several editable sections but displays all page content on one page
  • changes the ____ directive to ====
  • works with 2beta54 and supports Site.EditForm. You have to change in scripts/forms.php line
    if ($action != 'edit') return; 


    if ($action != 'edit' && $action != 'editpage') return; 

Version 1.4+ has an auto section function: every header should get an edit section link, if you put

    $BreakPageAuto = true;

in your config.php before the include line. To avoid auto sections for a side (i.e. SideBar) put


on it. If you use auto sections the ==== does only go until the next header element. If an introducing ==== is missing in the header section it is set for the user automaticly.

Schlaefer August 31, 2005, at 01:50 AM


  • Pm, Sep-06-2004
  • jr, Sep-06-2004 enhancements 8 Nov



See discussion at BreakPage-Talk

User notes : If you use, used or reviewed this recipe, you can add your name. These statistics appear in the Cookbook listings and will help newcomers browsing through the wiki.