Conditional Page Breaking

来源:互联网 发布:淘宝购物联名信用卡 编辑:程序博客网 时间:2024/05/22 05:31
Quick tidbit today from Hok Min, the new RTF uber meister. It came out of a question with someone trying to use the 'split-by-page-break' command in a bit of a funky way. They had the following code:
<?if:CF_LPN_FLAG='Y'?> <?split-by-page-break: ?><?end if?>

Its a nice enhancement candidate but its not going to work. We are expecting the split-by-page-break command inside a loop not as part of a condition. Say, you're looping over departments (DEPT) and want a page break when the department changes. You'd have something like


<?for-each:DEPT?>.........<?split-by-page-break:?><?end for-each?>
This would get out engine to insert a page break into the document before the occurrence of a new department. To get the original code above to work you physically need to insert a page break into your template. Kinda screws the WYSIWYG layout a bit but you get the desired functionality i.e. a conditional page break. For a sample RTF and XML click here
0 0
原创粉丝点击