Managing Websites and Paging Content
I've given this subject a good amount of thought and still haven't come up with something I'm happy with so I'm putting the question out there for the public to chew on.
Background: For “Lessons” (articles) on the DevCampus site, there is a very good chance that the content will be lengthy. By “lengthy” I mean more than 10 printed pages -possibly more than 15 or even 20 printed pages. I'm going to do my best to break the content down into lessons that don't require an entire evening to get through but, some topics will take a lot of text and images to cover properly. So I was thinking about paging the content of the lessons, so that people could bookmark a URL that takes them to a specific page of the lesson and they can pick up where they had previously stopped reading.
Question: Without creating multiple records in the database table (a record per page), how do I page the content? I'd really like to be able to manage the content of a lesson as a whole while creating and editing it. I don't want to have to choose a certain page to edit or add multiple pages to an article while adding it to the database. This would be easiest for DevCampus editors that help me manage content on the site also. I don't want them to have to remember special rules for managing content.
As most of you reading this probably know, “Paging” of data traditionally relies upon setting a page size (a certain number of records) and then being able to access a page count property (which is usually just the record count divided by the page size). Also, the dataset/recordset can typically be filtered to the current page's records only so moving through the records is still really simple. How do I achieve paging though, without setting a page size, without having a page count, and without record filtering capabilities? I've resigned myself to thinking there is no way to do this short of creating my own custom solution.
My own solution (idea) consists of mimicking paging behavior but, in a way that is suited for a single record containing a lot of text. First, setting a page size that is a number of bytes (say, 75,000) and then using that number to get a page count by dividing the total number of bytes the article consists of by it. The only problem with this simplified solution is that it would likely cut words off randomly and not really allow me to set page breaks at a specific location in the content, which is important. I'd prefer the pages to break at the end of a section or paragraph in the lesson. I thought of putting special “page break” characters or symbols in the content but that would require an expensive parsing of the entire article looking for the page breaks and then keeping track of how many of the page breaks I've found when the page requested isn't the first page. This also seems like it would be a maintenance nightmare. If content is added or taken away from the lesson, there's a good chance the page break char/symbol location would need to be adjusted to give a proper page size.
So, has anyone out there dealth with this kind of issue before? If so, what'd you do? I'm interested in hearing.