-
- 1,495 Posts
I believe there are easier way to do it, which is using dhtml, and have it in several layers, and make seemlesly appeared as if it’s on different pages. The bad thing is, you need to include a code in your database. Another solution which is to use plugin and tap into the document and apply a div that act as a layer.
Well anyway, I have no experience in this kind of stuff, so hoopefully my idea can be an inspiring solution for you.
Sincerely,
Wendy Novianto
-
- 30 Posts
I was thinking about the same thing for a site I’d like to develop. The easiest way I can think of is to create a snippet that would check the size of the article (content field in the database) then divide it into equal sized chunks to display over however many pages.
I haven’t tried to create a snippet yet but it’s the best way to learn php, and I may eventually.
I think you can check the length of the content field within a mysql query and then divide the text into arbitrary chunks (number of characters?) to get the number of pages you’ll need and retrieve just the first page section, and create the 1,2,3,4... page links you need to retrieve each part with subsequent requests. I haven’t worked it out yet. Not sure I will be able to either - but I won’t know until I try!
Actually there are probably a number of pagination scripts out there that could be ’borrowed’ and modified.
"Adversus solem ne loquitor." -don’t speak against the sun (don’t waste your time arguing the obvious) Something I sometimes need to be reminded of.
-
- 3,250 Posts
You could create a snippet that would follow the following logic:
Get content field of current document
Trim content based on # of characters to be show (passed through the smart filter in NL to catch open tags) starting at the nth character (retrieved from URL)
Output results
-
- 141 Posts
Thanks for the replies.
Wendy - I have thought about using divs but, in this case, I want it to appear as if the page has changed. However, I have an idea about that.
Zatoichi, Mark - the problem with using a fixed number of characters is that the sense of the article may be disrupted. It is better to let the author choose where the breaks occur, I think.
Since noone has said "there is already a snippet to do this" then I shall have a go myself, probably combining both ideas. If it works out and is any good I shall, of course, post it back to the forum.
-
- 1,495 Posts
Nice zenmaster.
I believe you can use plugin to handle the querystring to determine which sub pages that they are browsing, and I believe you can tap into the document parse, right before they parse the content, and you can use regular expression or some other string function to determine the splitter point, and substitue the TV with the right contanent.
Let us know if you could do it.
SIncerely,
Wendy NOvianto