Page Breaks - thanks to Dan G. Switzer

I usually don't add a new feature right away. I usually will have it in my head for a little while and mull it over a fair amount before I start writing the code for it. Today was a bit of an exception. Dan Switzer, the sharp guy behind qForms posted this pretty simple concept on his blog for creating a word-processor-like page break. That is a page break that appears visually on the screen where the page break is going to occur when printed.

Now I'd used the CSS for page breaks before, but somehow it never occurred to me to do anything like this until Dan mentioned it. I guess I hadn't been to observant when using MS Word. :) And when I saw Dan's blog I smacked myself in the head, because it was so obvious. He did a great job of subtlely enhancing the user experience, so he gets kudos from me.

And given its simplicity I decided to go ahead and integrate it right away. You'll now find in the XHTML library that there's a new tap:pagebreak tag that will create these handy little things for you. Your code would look something like this:

<cf_html ...>
<div xmlns:tap="">
<p>stuff here</p>

<p>stuff here</p>

<tap:pagebreak />

<p>more stuff</p>

<p>more stuff</p>

I've only added two things to Dan's original code. One is I added @media aural to the CSS to hide the page break elements to screen readers. The other is that I made the "page break" label in the middle localized to the language in use.


BlogCFC was created by Raymond Camden. This blog is running version 5.5.006. | Protected by Akismet | Blog with WordPress