BreakPage

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, ...

Description

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Δ

  • separates 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; 

into

    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

 (:nosections:)

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

Contributors

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

Sandbox

Comments

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.

Array
(
    [post_max_size] => 64M
    [$_POST keys] => 
    [$_REQUEST keys] => n
    [$_SERVER] => Array
        (
            [CONTEXT_DOCUMENT_ROOT] => /home/pmwiki/public_html
            [CONTEXT_PREFIX] => 
            [DOCUMENT_ROOT] => /home/pmwiki/public_html
            [GATEWAY_INTERFACE] => CGI/1.1
            [HTTPS] => on
            [HTTP_ACCEPT] => */*
            [HTTP_ACCEPT_ENCODING] => gzip, br, zstd, deflate
            [HTTP_HOST] => www.pmwiki.org
            [HTTP_USER_AGENT] => Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
            [HTTP_X_HTTPS] => 1
            [PATH] => /bin:/usr/bin
            [PHP_INI_SCAN_DIR] => /opt/cpanel/ea-php70/root/etc:/opt/cpanel/ea-php70/root/etc/php.d:.
            [QUERY_STRING] => n=Cookbook%2fBreakPage
            [REDIRECT_HTTPS] => on
            [REDIRECT_QUERY_STRING] => n=Cookbook%2fBreakPage
            [REDIRECT_SCRIPT_URI] => https://www.pmwiki.org/wiki/Cookbook/BreakPage
            [REDIRECT_SCRIPT_URL] => /wiki/Cookbook/BreakPage
            [REDIRECT_SSL_TLS_SNI] => www.pmwiki.org
            [REDIRECT_STATUS] => 200
            [REDIRECT_UNIQUE_ID] => afSsiqTjGlaEpgdTxT6YNAAAAAA
            [REDIRECT_URL] => /wiki/Cookbook/BreakPage
            [REMOTE_ADDR] => 216.73.216.25
            [REMOTE_PORT] => 21945
            [REQUEST_METHOD] => GET
            [REQUEST_SCHEME] => https
            [REQUEST_URI] => /wiki/Cookbook/BreakPage
            [SCRIPT_FILENAME] => /home/pmwiki/public_html/index.php
            [SCRIPT_NAME] => /index.php
            [SCRIPT_URI] => https://www.pmwiki.org/wiki/Cookbook/BreakPage
            [SCRIPT_URL] => /wiki/Cookbook/BreakPage
            [SERVER_ADDR] => 23.254.203.248
            [SERVER_ADMIN] => webmaster@pmwiki.org
            [SERVER_NAME] => www.pmwiki.org
            [SERVER_PORT] => 443
            [SERVER_PROTOCOL] => HTTP/1.1
            [SERVER_SIGNATURE] => 
            [SERVER_SOFTWARE] => Apache
            [SSL_TLS_SNI] => www.pmwiki.org
            [TZ] => America/Los_Angeles
            [UNIQUE_ID] => afSsiqTjGlaEpgdTxT6YNAAAAAA
            [PHP_SELF] => /index.php
            [REQUEST_TIME_FLOAT] => 1777642634.8861
            [REQUEST_TIME] => 1777642634
            [argv] => Array
                (
                    [0] => n=Cookbook%2fBreakPage
                )

            [argc] => 1
        )

)