ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Pagination -- Is there a way to break into pages after a certain number of lines or characters?

February 17, 2010 10:14pm

Subscribe [3]
  • #1 / Feb 17, 2010 10:14pm

    Hoopsgal

    181 posts

    I’m having a hard time with a couple of extra-long articles.

    Even if I expand the allowed length of my article body section by absurd numbers in the Section Administration dialog, I’ve found that Expression Engines will automatically cut off the article at a certain point (regrettably, I don’t know what that point is) if the article is too long. I’m assuming that there must be some maximum number of characters the database will hold in a given field no matter what you do in Section Admin.

    Anyway, I’ve tried to work around this problem by creating a new special entry field called “article body extension,” and putting the surplus material there. This seems to work in Firefox, but it appears it won’t show up in certain other browsers (I.E. in particular).

    Even in Firefox, however, there is the problem that an article this long requires an enormous amount of scrolling. I’ve read the documentation on paginating, but it seems to pertain to automatically putting a page break (and links) in after a pre-defined number of weblog entries. In this case, I’m creating a single entry, but want to break just that entry (and perhaps a few other extremely long ones) into multiple pages with next page/previous page links. Is there a way to either manual place these page breaks in the text or to tell expression engine to place them after every X-number of characters, instead of after X number of weblog entries?  Thanks.

  • #2 / Feb 18, 2010 2:13am

    John Henry Donovan

    12339 posts

    Hoopsgal,

    You can specifically span an entry across multiple pages using the multi_field variable

    EE Docs : Spanning a Weblog Entry Across Multiple Pages

  • #3 / Feb 18, 2010 4:59am

    Hoopsgal

    181 posts

    Thanks, John.

    If I understand the explanation in the link correctly, what I need to do is set up new custom entry fields for Page 1, Page 2, Page 3 of the article body (presumably giving each a more reasonable field length). So instead of dumping everything in a single article body, I might have half a dozen or so “subbodies,” if you will.

    In doing this, I want to be careful not to destroy previously published articles—i.e., if I go back and redefine the article body field to take only, say, 1000 words max—I want to be sure that I don’t truncate all the previous articles in my archives that had article bodies of 1,000 words-plus. Any suggestions on how to do this? Is there some way I can do a search to find all articles where the article body field is more than X number of words (or characters or whatever is appropriate) so I can go back to redo those articles with the multiple-page approach?

    Also, do you have any idea why the article-body-extended field doesn’t show up in some browsers? Because in essence, it’s a “page two” just with a different name associated to it.

    Thanks again

  • #4 / Feb 18, 2010 5:35am

    Ingmar

    29245 posts

    Even if I expand the allowed length of my article body section by absurd numbers in the Section Administration dialog, I’ve found that Expression Engines will automatically cut off the article at a certain point (regrettably, I don’t know what that point is) if the article is too long.

    Yes. Actually, it’s not EE as such, but your db can’t take more text. That cutoff point should be 2^16-1 = 65,535 characters. If you need more than that, per field, you’ll have to manually change the field type from TEXT to MEDIUMTEXT which gives you 2^24-1 chars to work with. You can do this in phpMyAdmin, or by running a query like

    ALTER TABLE exp_weblog_data MODIFY field_id_10 MEDIUMTEXT

    Just make sure to specify the right field_id_ , and do keep a db backup just in case 😊

    I’m assuming that there must be some maximum number of characters the database will hold in a given field no matter what you do in Section Admin.

    VoilĂ .

  • #5 / Feb 18, 2010 5:40am

    Ingmar

    29245 posts

    So instead of dumping everything in a single article body, I might have half a dozen or so “subbodies,” if you will.

    Yes, that’s precisely how it works.

    Any suggestions on how to do this?

    Just keep your body as it was for now, and add another custom field. Then use something like

    {multi_field="body|body_extension"}

    it will only be paginated if body_extensions is not empty.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases