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
Installation
- Download the plugin and unzip it on your Desktop
- Copy/upload the contents of
Desktop/SuperPage-0.9/pluginsinto/path/to/mt/pluginson your web server.
Usage
- 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.












Leave a comment