By Tim Dexter on Jan 05, 2010
Happy New Year everyone! Hopefully you are well rested and getting back into the swing of BIP. I took 2 weeks with a huge list of to do's ... sadly I managed only 2/10! A friend once told me to put a couple of things on a list that I had already done so I could tick them off immediately and feel good about my progress :0) Im pleased to say the 2 I did get done were real tasks so all was not lost.
Got a mail today from a customer having some issues conditionally showing bookmarks for a PDF output or a table of contents for HTML output. I blogged some of the solution a while back but thought I would share a template today to avoid any confusion.
Here's the template
- Param - <?param@begin:_xf;"html"?> - this declares the output format parameter that the server will pass to the template at runtime.
- if PDF - <?if:$_xf='pdf'?><?convert-to-bookmark:?> - if the output is going to be PDF then create the book marks
- Then we have the first instance of the TOC in the template
- EI - <?end convert-to-bookmark:?><?end if?> - closing out the if and the bookmarks
- if HTML - <?if:$_xf ='html'?><?copy-to-bookmark:?> - if the output is going to be HTML then leave things as a TOC
- Then we have the second instance of the TOC in the template
- EI - <?end copy-to-bookmark:?><?end if?> - closing the if and copy
Not too tough and once the template is deployed to the server you will get the desired effect in the output of choice. Template available.