Live Forums/ Traffic LIVE/Templates Library

Code to suppress blank pages

Traffic LIVE
posted this on November 24, 2011 09:40

Our more recent templates include code to suppress blank pages.

 

We cant update them centrally as this would wipe out all of your changes! If you have no terms and conditions etc and are getting an extra page this is the code change we applied

 

 if ( $("#annex").contents().length > 0 ) {
         createNewPage(true, true);
         var clearAnnex = getNewClearAnnex();
         clearAnnex.appendTo(getCurrentContentHolder());
         var paragraphs = getNewAnnex().children();
         paragraphs.each(iterateAnnex);
        }
the code inside if statement is in original template. Wrapping that with this if statement makes sure no blank page is added when annex is empty

 

 
Topic is closed for comments