Thank you Xpix and Breezer,
So I took both of your advice and "kind of" got it working:
http://www.ttmags.com/index.php?id=16#
I downloaded the Dynamic Drive Javascript. I liked it because it keeps all the content on one page and just hides the rest in a div (or container of choice). If the user has javascript disabled, they just simply get the whole story. This appeals to me for two reasons: 1. You can control the style and elements with CSS and 2. Search Engine Optimization
So all I had to do was figure out how to auomatically divide the content by character count and then wrap or format it in a div with class.
After some time I found the php function string split:
http://us.php.net/manual/en/function.str-split.php
Then after hours and hours pouring over php tutorials and scripts tc etc.
I came across this post at PHPfreaks.com by paul2463 that was extremely helpful:
http://www.phpfreaks.com/forums/index.php?topic=139886
I then changed my template to suit the js and linked the script.
I fiddled with the php a bit and you can see the results above.
Here is the snippet:
<?php
function splitString($string, $amount)
{
$start = 0;
$end = $amount;
while ($end < strlen($string)+$amount) //while $end is less than the length of $string + $amount to make sure it gets is all
{
$strArray[] = substr($string, $start, $amount);
$start = $end;
$end = $end + $amount;
}
return $strArray;
}
$test = $modx->documentObject[’content’];
$return = splitString($test, 3600); //$return = the array of 3600 letter strings
print_r("<div class=\"virtualpage hidepiece\">".($return[0])."</div>");
print_r("<div class=\"virtualpage hidepiece\">".($return[1])."</div>");
print_r("<div class=\"virtualpage hidepiece\">".($return[2])."</div>");
print_r("<div class=\"virtualpage hidepiece\">".($return[3])."</div>");
print_r("<div class=\"virtualpage hidepiece\">".($return[4])."</div>");
print_r("<div class=\"virtualpage hidepiece\">".($return[5])."</div>");
print_r("<div class=\"virtualpage hidepiece\">".($return[6])."</div>");
print_r("<div class=\"virtualpage hidepiece\">".($return[7])."</div>");
print_r("<div class=\"virtualpage hidepiece\">".($return[8])."</div>");
print_r("<div class=\"virtualpage hidepiece\">".($return[9])."</div>");
print_r("<div class=\"virtualpage hidepiece\">".($return[10])."</div>");
?>
So here are my current challenges. One, as you can see, I am using the print_r function to display sections of an array. Unfortunately, that creates empty divs that are then read by the javascript and translates into empty pages in the bottom navigation for the user. Are there any PHP wizards out there that can tweak this script so that it creates the right amount of divs?
Also, it splits words. Is there a way to make it stop doing that?
And finally, is there a way to automatically create a "continued from" on the second and following pages?
I apologize profusely to any PHP or Javascript experts who may look at this ham hocked code and/or method in disgust.
My only defense is that I am a newbie who knows his way around CSS and wants this to work.
Any help would be greatly appreciated.
s.