You are not logged in.
Splits articles in pages, assigns names to them, and produces controls for page navigation.
[page](lowercase; case matters) and then another newline (whitespace also matters!) where you want to insert a page break.
<txp:etz_pg_body />where you’d put
<txp:etz_pg_pages />to insert your navigation controls.
To optionally assign titles to the generated pages, you have to:
etz_pg_subs(lowercase; case matters), via the “Advanced preferences” of Textpattern’s admin interface.
etz_pg_subscustom field, for an article with, let’s say, four pages, write “This is page one|This is page two|This is page three|And last but not least, page four”. The names of the pages are separated with vertical bars. Note that the number of the vertical bars must be equal to the number of the
[page]separators in the body article.
This version of the plugin comes fully loaded with everything you need to add a new level of structure and navigation to your TXP site!
<txp:body />. Available attributes are:
pgerrspecifies a custom “Invalid page number” message. This is also useful to define a message in a language other than English.
notrimif set to non-zero disables the XHTML validation hack. You shouldn’t have to use this under normal circumstances.
<txp:etz_pg_pages />inserts the plugin’s standard navigation controls. These can be a list of page names, provided that you have assigned page names manually (read above), or simply a list of page numbers by default. Available attributes are:
alwayswill create navigation controls even if the article isn’t paginated
endwhich define the text for the respective navigation links.
noextremesif set to non-zero disables start and end links.
noadjacentsif set to non-zero disables prev and next links.
nonumbersif set to non-zero disables navigation by page numbers, or by page names, provided that you have assigned page names manually (read above).
usenumbersif set to non-zero will use only page numbers for navigation, even if you have assigned page names manually (read above). This is always overriden by the one above.
idsets the name of the
<ul>@id@ HTML attribute (default: pages).
<txp:etz_pg_switchmode />inserts a smart link that enables you to switch from split view to whole article view, and vice versa. Available attributes are:
idsets the name of the
<ul>@id@ HTML attribute (default: switchmode).
allsets the text for the link to the whole article view mode (default: “all pages”). This is also useful to define a message in a language other than English.
splitsets the text for the link to the split article view mode (default: “split in pages”). This is also useful to define a message in a language other than English.
<txp:etz_pg_custom />provides a custom navigation component, which is especially useful if page names have been assigned. It a custom text message e.g. containing the title of the page, optionally linking to page. Available attributes are:
text, which defines the output text. Defaults to the template variable
%t(lowercase; case matters), which corresponds to the title of the referenced page. Another template variable available is
%n, which corresponds to the referenced page’s number.
mode, which can either be optionally
absmeans that the
pageattribute refers to the absolute page number; a negative number, e.g.
-1will denote the last page of the article,
rel, on the contrary, denotes that
pageis an offset (either positive or negative) from the current page.
page, as implied by the above, is an integer (default: 0).
linkif set to non-zero enables a link to the referenced page.
titledefines the text in the HTML “title” variable for the link. Just like the
textattribute described above, it defaults to
%t, accepting the exact same syntax.
<txp:etz_pg_if_not_split>are conditionals to tell whether the article is currently displayed in the split mode, or not.
<txp:etz_pg_if_not_paginated>are conditionals to tell whether the article has a split mode, or not.
<txp:etz_pg_if_not_start>are conditionals to tell whether the start of the article is currently displayed, or not.
<txp:etz_pg_if_not_end>are conditionals to tell whether the end of the article is currently displayed, or not.
<txp:etz_pg_if_not_titles>are conditionals to tell whether page titles have been assigned, or not.
<txp:etz_pg_current />returns the current page’s number in split mode, or “all pages” if all pages are displayed.
allcan set another message to replace the default “all pages”. This is also useful to define a message in a language other than English.
<txp:etz_pg_totalpages />returns the total pages number.
[page]separators get indexed in search (workaround).
Once a fork of DarkWulf’s hfw_pg_* plugin, this plugin is almost a complete rewrite of its predecessor. Notable enhancements are:
This software is both free as in beer and free as in freedom. If you like it or think it’s useful, you may consider bying me something from my wishlist.
Last edited by Etz Haim (2007-10-23 18:38:58)
Great work, thx! I’ve a suggestion about the navigation. if we use a attribut for the [page] tag, e.g.
[page title=“My first paragraph”]
then in the navigatiion block we could use the titel tags as arrangement if you like (done by another parameter) .. jut an idea ;o)
Released updated version 0.3 of the plugin. This is mainly a code cleanup release.
<txp:etz_pg_body />enables to specify a custom “Invalid page number” error message.
<txp:etz_pg_pages />if set to non-zero disables the XHTML validation hack. Use this one with caution.
currentclass defined for the current page’s
NOTE: To update to this version, you have to update your CSS stylesheet(s) to use the
current @<li>@ class.
Last edited by Etz Haim (2005-02-11 09:10:11)
I can’t seem to open your archive file. Get the error message “Can’t read from this file”.
Could you perhaps post a plain text file? Thanks.
Your updates sound excellent, looking forward to trying it out.
Download and install a file archiver that supports the GZip format. If your platform is win32, I suggest 7-zip.
I use PwerArchiver which supports GZip as well but for some reason it wasn’t able to extract your file. 7zip worked, though. Thanks.
Released updated version 0.5 introducing new feature:
<txp:etz_pg_switchmode />and the ability to display whole article in a single view.
<txp:etz_pg_if_not_split>are who new conditionals, and are part of the new API where
<txp:etz_pg_if_not_paginated>assume a slightly different role (RTFM).
How to upgrade from version 0.3:
<txp:etz_pg_if_not_paginated>conditionals in your article form(s) you may have to change them to
<txp:etz_pg_if_not_split>, depending and what you need them for.
A possible workaround for a known bug: If you have an english language website and you don’t what
[page] separators to get indexed in your searches, consider editing the plugin code and replacing
[page] in the
etz_pg_break() function with something impossible to be included in a search, eg.
[2adf5211] (part of an MD5 digest actually). Then, change all your articles accordingly. Make sure your replacement does not have any meaningful substrings.
I have a question:
is it possible to insert some ‘page’ tags in article and after that somehow to get whole page on single page? It would be useful to have some link like “To get whole article”, e.g. for printing or saving…