Paging is great and it works, but it doesn't provide functionality that seems to be a mainstay of the web these days. For example, almost all multi-page documents these days have a pulldown menu that lists all the pages in the document, at the top of each page. Of course, pages don't have names so there's no way to implement that without changing the way paging behaves.

However, if you could specify a name for the page after the break, then this functionality could be provided. Perhaps it should be <--pagebreak--> as normal, but you can also specify <--pagebreak--page name goes here--< or some other such syntax.

It would be wonderful to see someone else implement this functionality so I don't have to figure out how the pager works :)

CommentFileSizeAuthor
#4 paging_7.module8.52 KBGurpartap Singh

Comments

Gurpartap Singh’s picture

Basically, this is how it could look like:
[pagebreak name=name of this page]

Make the square brackets strict? Or is there so much need making pagebreak code flexible via settings? Page names can be stored within database, but the code will need to grow more, getting this functional.

This all can turn 'paging' into a super usability module :)

hyperlogos’s picture

You don't need to reference pages by name, you can do that by page number (offset) and the name is in the page content, so it could be retrieved with a SQL query and a little mangling if it needs to be displayed somewhere. OTOH it might not be a bad idea to cache them in the db when a node is saved, because it would make them a lot easier to look up and reduce the cost of building the list of pages.

hyperlogos’s picture

Oh, and we need a syntax for making a link to another page. Perhaps in addition to an offset from page 1 (or 0) we could have "next" and "previous" arguments to that link syntax as well.

Gurpartap Singh’s picture

Version: 4.7.x-1.x-dev » 5.x-1.0
Status: Active » Needs review
StatusFileSize
new8.52 KB

Here's something I have currently to offer(currently only Drupal 5.x). There must be something missing or any bug. New setting is created to enable/disable pages list. When enabled, a titled list of pages is shown below the content. Use the following syntax to give titles to each page:

[pagebreak title=Lorem Ipsum...]

Use the following for the first page\'s title:

[firstpagebreak title=Lorem Ipsum...]

Default titles are "Page 1, Page 2" and so on.

Not much to write at the moment, but code needs review ;) Might look scary, that's not clean I know. Will take some time reviewing tomorrow.

AlaShiban’s picture

Any updates on this? Any way to speed this up ^_^? Perhaps some Incentive behind the table will work :D?

vph’s picture

hello, why not use book.module?

hyperlogos’s picture

Because even some of my book pages would like to have their own paging, and it doesn't make sense to turn them into books or hierarchies in their own right because of the added complexity - I would for example like them to print as a single page.

Gurpartap Singh’s picture

so how's the above code? haven't touched paging since then!

hyperlogos’s picture

To be honest, neither have I. I've kind of been avoiding messing with my site for a while pending a change in hosting. I do have a copy of it installed on my machine though, and I'll see about playing with this next week.

moshe weitzman’s picture

Looks like I'll be needing this. I'll report back my results.

Gurpartap Singh’s picture

Thanks moshe! Will sure need more hands into it. And using [ and ] might not be the best option. With this patch, the user gets to choose only pagebreak from [pagebreak name=fooo foooooooooo]. Some code could be put in to allow user set the whole part of it except "name=fooo" part, i.e. something like <!--pagebreak %name--> where %name is a placeholder for naming format. And further configuring it for the regex, etc etc. Maybe i'm lost due to busy time here.

Needs review and patches if possible :) !

Gurpartap Singh’s picture

Version: 5.x-1.0 » 5.x-1.x-dev
Status: Needs review » Needs work

.

maxiorel’s picture

[pagebreak title=Lipsum...] seems to be working in paging_7.module. However the [firstpagebreak] cannot be in teaser. If so, it is displayed on the teaser list.

batman1983’s picture

It works fine!!!

Is it possible to create a block with the page names?

darren oh’s picture

Let me make sure I understand what we are trying to do here. I found three objectives:

  1. Give each page a name.
  2. Print multiple pages together (#7).
  3. Provide a menu or block with a list of pages in addition to the paging element at the bottom of each page.

The first two things can be done with the book module. See the Drupal handbook for an example. In fact, using paging for these purposes would be incorrect, because paging is about the display, not the organization, of a document. The third objective does not require page names.

The paging module will maintain its usefulness best if it stays independent of the structure and organization of documents and focuses on document display.

sun’s picture

Quick thoughts on this one:

- [pagebreak] syntax is fine, because it will open up compatibility with Inline API. When Inline API will be ready, users would be able to insert and edit page separators through a button that opens a dialog to enter/configure each tag.

- Joomla uses a very simple, but flexible approach: it's macro is something along the lines of {pagebreak title=Heading for next page}, while the first page always has the default title. That would translate into [pagebreak title=Heading for next page], or given Paging's current default separator: <!--pagebreak|title=Heading for next page-->. Note: Using a single pipe as delimiter is the most safe character based on my experience.

- Gurpartap suggested a separate inline macro containing <!--pagenames:First page||Page no.2||Chapter 3-->. However, I vote -1 on this, because adding/editing/maintaining this macro (probably at the beginning of a content) will be a mess from a usability perspective. It makes perfectly sense to enter an inline tag to add a page break, and optionally enter a title for this page right behind it (into the same tag).

panji’s picture

Yes, Joomla paging is much more better,... simple and easy,.. how can we get there?? :(

Gurpartap Singh’s picture

Version: 5.x-1.x-dev » 6.x-1.0-beta1
Status: Needs work » Fixed

Right at it in the D6-paging's first beta release!

panji’s picture

That was awesome.... unbelievable.... Thanks GREAT JOB Bro..!!

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

maxiorel’s picture

Status: Closed (fixed) » Active

I used the [pagebreak title=Page title] syntax for more than a year. Now I would like to upgrade to Drupal 6, however the newest version of this module doesn't support this syntax. Is there any chance for successful upgrade?

Gurpartap Singh’s picture

Code in the issue queue is never intended for production but I still saw some taking the leap for the posted module. Although the convert is very much possible but I doubt if I'll find time to take this up anytime soon.

sun’s picture

As mentioned in #16, I highly recommend using the [ ] syntax. Otherwise, those tags are most probably not compatible with client-side editors (wysiwyg) and stripped from the content during editing.

Gurpartap Singh’s picture

I won't mind using square braces instead of HTML comment format. i.e. something like [pages:first page|secondpage]. Inline page titles would be difficult to maintain(for developer). We won't be able to define page names for pages created "automatically". This reason is enough for me to not adopt "inline" titles. Even the page names UI's code would get much more complicated than it is now. Inline conversion update from current 6.x style would be omg complex. :P

Other systems like Joomla use inline method because they are limited to the basic paging functionality with names, unlike Drupal's paging module.

The reason for choosing HTML comment format was that it won't appear in node content when paging has been disabled. IIRC tinyMCE doesn't strip html comments as even it has been using comment for pagebreak. And double pipe's there to let the user be able to have at least one pipe in page titles(quite clumsy I know).

I wonder what benefits Inline API would bring.

So how about [pages:First page title|Second page title] anywhere in the text for page names and the usual pattern for page breaks?

Gurpartap Singh’s picture

Also specifying a totally new page separator string's format would mean breaking existing websites because of mandatory square braces. An upgrade for this would be (not hard but) impossible.

sun’s picture

See also #351725: SWF Tools <swf></swf> tags being removed by Tiny MCE as an example for how the upcoming bug reports and support requests will look like.

As mentioned before in this issue and in IRC, Paging should implement inline macro tags in the form of [paging|title=Next page title] for this feature. We should also consider to drop the paging tag customization feature (i.e. just leave the variable). For backwards compatibility (and until Inline API will help us updating existing contents), the easiest way to move forward would be to parse both, the previously configured paging tag (i.e. <!--pagebreak-->), and the new inline macro tag.

That way, existing tags will work as before, but users who wish to use the new paging feature with names need to update their tags. Using the aforementioned syntax for inline macro tags is what the user would expect, and makes those tags also compatible with the current efforts with Wysiwyg/Inline API (i.e. content-editing in general).

Gurpartap Singh’s picture

Looks like a lot more interesting work for me to complete. <8-]

jenlampton’s picture

Status: Active » Closed (duplicate)