SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    Non-Member Icheb's Avatar
    Join Date
    Mar 2003
    Location
    Germany
    Posts
    1,474
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Splitting an article over multiple pages

    I am currently coding a small CMS for our site (basically just for fun) and I would like to have the ability to split our current and future articles over multiple pages. I came up with several possibilities and I would like to hear your input on what would the best way to do so.


    1. Doing it entirely automatic
    A "word count" setting would be introduced, which limits the amount of words on one given page. The function would make sure the content for every given page would end with a dot, which is not a problem.
    This is the solution I finished coding a few days ago. The problem is, the editor can't control where the function makes the "cut".

    2. Doing it "semi-automatic"
    A special string would be introduced which tells the function where to make the "cut". When an article is being added this string would be inserted automatically by a function based on the code from solution 1, and the user can move it around to make sure the "cut" really fits.
    Question is: Is this really necessaire or would the first solution do the job?

    3. The editor does it all by himself
    There is no "word count" setting which enables the editor to make sure every page is roughly equal in length, he has to do that himself.
    The problem with this solution is that the editor has to make sure that one page is neither too long nor too short, he has no function which aids him.

    I am torn between solution 1 and 2. With the first solution, the editor would have less work. He could just proof-read the article, insert it, hit submit and he's all set. However, checking the special strings for an appropriate position wouldn't be much more work, but is that really necessaire?

  2. #2
    SitePoint Wizard
    Join Date
    Mar 2002
    Location
    Bristol, UK
    Posts
    2,240
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Option 2 I think sounds the best You don't want the 'cut' to be halfway through a section which should be all together on the same page.

    -Sam
    Sam Hastings

  3. #3
    Non-Member
    Join Date
    Jan 2003
    Posts
    5,748
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ummm....

    I would think that you'd need to create a database table which would hold IDs pointing to each page of the article, and then creating links within the web page (ie $_GET) with each unique ID (ie page) of this article; much like paging results though limited to the number of pages per article rather than search results...

    There is an article over at www.zend.com covering this though I wouldn't say to it's quality or in depth coverage ?

  4. #4
    Non-Member Icheb's Avatar
    Join Date
    Mar 2003
    Location
    Germany
    Posts
    1,474
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It really seems like solution 2 is the prefered method. Thanks for your input .

    Does someone happen to know how SP does it? Their page lengths on the article pages vary extremely sometimes.

  5. #5
    Non-Member
    Join Date
    Jan 2003
    Posts
    5,748
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Extreme ? That is an understatement....

    Just looking over their JSP article....

    39 pages folks... Near put me to sleep.... ZZZzzzzz....

  6. #6
    Non-Member Icheb's Avatar
    Join Date
    Mar 2003
    Location
    Germany
    Posts
    1,474
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I meant the amount of words displayed on one page, not the number of pages.

  7. #7
    Non-Member
    Join Date
    Jan 2003
    Posts
    5,748
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well, excuse me :P:


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •