Super Page for Movable Type

The Super Page plugin for Movable Type was created in support of Movable Type's documentation effort. The basic need was this:

  • convert a single, massive page into a set of paginated, easy to navigate pages broken up by chapter/section.

This plugin solves that problem by allowing authors to flag a regular Movable Type page as a "Super Page." When that page is saved, the plugin will automatically partition it into multiple pages and generate a table of contents for the Super Page. The plugin also makes available a set of template tags that allow you to construct next page and previous page links for all of the child pages derived from the parent Super Page.

Each "child page" is delineated by a HTML header.

Download

Reporting Bugs

Super Page is constantly being improved upon. To report a bug please use the following resources:

Installation

To install this plugin follow the instructions found here:

http://tinyurl.com/easy-plugin-install

Usage

Super Page Plugin Screenshot

  • To mark a page as a "super page" edit the page in question and under "Publishing" toggle the "Super Page?" checkbox. Then save the page and the child pages will be created for you automatically.
  • When you delete a super page, all of the child pages will be deleted as well. This cannot be undone.
  • Child pages will inherit all of the parent page's properties vis-a-vis commenting.
  • A table of contents page with a basename of 'index' will be created for you automatically in markdown.

Caveats, Known Issues and Warnings

  • Super Pages must be formatted in markdown
  • All headings, which map to the titles of each child page must be unique. When you change a heading, and thus a page title, comments on that child page will be permanently deleted. PLEASE BE CAREFUL if you want to preserve these comments.

How It Works

Super Page works with pages that have been formatted in Markdown. It divides the document into "sections" based upon markdown headers. Markdown headers are those lines that begin with one or more pound (#) characters, and get translated into <h1>, <h2>, etc HTML tags. Every header then becomes the title of a section, which in turn becomes the title of the page that is created by Super Page.

When you mark a page as a super page, the plugin attaches meta data to that page and flags it as the "parent page." Each child page that results from that parent page is also flagged accordingly. Additional meta data is attached to each child page to help indicate and track which page is the next and previous page in the sequence resulting from parsing the parent page into multiple child pages.

When a super page is updated in the system, the Super Page plugin partitions that page into its constituent sections. Then it attempts to locate and then update each section that was previously generated with the newly updated content from the parent page. This way, if child pages accumulate comments, those comments are preserved.

Super Page identifies pages based upon the section title or header tag. Therefore, by changing the title of a section, you risk losing any comments that may have been attached to that page by your community.

Template Tags

Super Page makes the following template tags available to help construct navigation links between pages.

  • <mt:IsSuperChildPage> - returns true if the current page is the artifact of a super page
  • <mt:IsSuperPage> - returns true if the current page is a super/parent page
  • <mt:PrevPageID> - returns the page ID of the previous page in the super page
  • <mt:NextPageID> - returns the page ID of the next page in the super page
  • <mt:ParentPageID> - returns the page ID of the parent super page

Sample Template Code

<mt:IsSuperChildPage>
<p>This is a super page!</p>
<ul>
<mt:if tag="NextPageID" ne="">
  <li>Next: <mt:NextPageID setvar="next">
    <mt:Pages id="$next"><a href="<mt:PagePermalink>"><mt:PageTitle></a></mt:Pages></li>
</mt:if>
<mt:if tag="PrevPageID" ne="">
  <li>Prev: <mt:PrevPageID setvar="prev">
    <mt:Pages id="$prev"><a href="<mt:PagePermalink>"><mt:PageTitle></a></mt:Pages></li>
</mt:if>
  <li>Parent: <mt:ParentPageID setvar="parent">
    <mt:Pages id="$parent"><a href="<mt:PagePermalink>"><mt:PageTitle></a></mt:Pages></li>
</ul>
</mt:IsSuperChildPage>

Example

Let's suppose I have a super page called "Test Page" who contents are:

# Overview

yadda yadda yadda

## About the Author

yadda yadda yadda

### Where to find more

yadda yadda yadda

## My Article

yadda yadda yadda

The pages that will result are:

  • Overview
  • About the Author
  • Where to find more
  • My Article
  • Test Page: Table of Contents

Licensing

Super Page is licensed under the same terms of Perl itself.

14 Comments

Hello, How would one go about translating the title of Table of contents of a super page?

I am working on this for you. For what language? And what is the translation?

Thank you very much!

It is in Icelandic. I would like if "Table of contents" were "Skráar yfirlit".

Thank you for the translation. I am looking now into how I can make this selectable within MT.

I intstalled the plugin but cannot find the checkbox on the edit page under publishing or anywhere. I checked the display options and nothing was found there either. the plugin is installed correctly.

Make sure under the "Display Options" fly out/menu accessible in the upper right hand corner of the posting screen has the "Publishing" option selected under "Metadata." If that is not visible than neither will the super page option be.

Or it is possible another plugin is conflicting with the code that inserts this link. If the above doesn't work, can you tell me what other plugins you have installed are?

Carwin - I think I managed to reproduce this issue. I just issued a fix: Super Page 0.96. Thanks for the feedback!

Feature Request!

When I go to edit a page which is "an artifact of a super page" I am warned: "You are editing the artifact of a 'super page.' Changes you make might get lost."

Can this message have a link to the page which is the SuperPage of the child page?

Your wish is my command. Feature implemented and can be found in the newly released SuperPage 0.96. Thanks Beau!

Warning

The filename/basename of your super page should not be "index" (nor should their be any other pages in the same folder with the filename of "index") or MT will return an error. As noted above SuperPage will create a page with the filename/basename of "index".

Using this plugin, it's not possible to use heading tags within the content of a page. Here's a spec for a possible solution...

Feature Request

In the plugin settings create two settings:

  1. 1. Max SuperPage Heading Depth - determines the max heading depth that SuperPage will traverse when creating pages. Value could be an integer or a string of "###".
  2. 2. Child Page Heading Start - the heading size which all headings in a child page should start. This is the number of "#" to remove before calculating the html heading tag to apply. Value could be an integer or a string of "###".

Example

If there are 3 levels of headings as such:

# Foo

Text content for Foo page.

#### FooA

Text content for Foo page under FooA heading here.

## Bar

Text content for Bar page.

### Baz

#### BazA

Text content for Baz page under BazA heading here.

##### BazB

Text content for Baz page under BazB heading here.

And Max SuperPage Heading Depth is set to "3", and Child Page Heading Start is set to "2", then SuperPage would create the folowing pages:

  • Foo
    • Bar
      • Baz

Page "Foo" would contain a heading "FooA" wrapped in a h2 html heading tag.

Page "Baz" would contain two headings: "BazA" wrapped in a h2 html heading tag and "BazB" wrapped in a h3 html heading tag.

(Note: The formatting of this comment will be richer if ol, ul, and li html tag styling were not reset with css.)

Try as I might, I have not been able to get this plugin working (using MT Pro 4.31). I was able to install the plugin, and the option (check box) exists to make each page/entry a super page. I've created a test page (and an entry) using Markdown, with the content of the page being:

Overview

yadda yadda yadda

About the Author

yadda yadda yadda

Where to find more

yadda yadda yadda

However, only ONE page is produced and all the above content is displayed within this one page.

Obviously I'm doing something wrong, but I can't for the life of me figure out what it is.

Any help would be appreciated.

Thanks, Sean

I did include the pound signs in the above comment, but they seem to have been stripped out.

Hi Byrne,

the plugin change DB (add or modify Table)?

Thank You

raffaele

Leave a comment

what will you say?


Recent Comments

  • Hi Byrne, the plugin change DB (add or modify Table)? Thank You raffaele ...

  • I did include the pound signs in the above comment, but they seem to have been stripped out. ...

  • Try as I might, I have not been able to get this plugin working (using MT Pro 4.31). I was able to install the plugin, and the option (check box) exists to make each page/entry a super page. I've created a test page (and...

  • Using this plugin, it's not possible to use heading tags within the content of a page. Here's a spec for a possible solution... Feature Request In the plugin settings create two settings: 1. Max SuperPage Heading Dep...

  • Warning The filename/basename of your super page should not be "index" (nor should their be any other pages in the same folder with the filename of "index") or MT will return an error. As noted above SuperPage will crea...

Close