Page breaks in conditional tags

Please post all new bug reports for Help & Manual 5 here.
Post Reply
Mark_Hazeldine
Posts: 102
Joined: Fri Jan 15, 2010 6:16 pm
Location: London, UK

Page breaks in conditional tags

Unread post by Mark_Hazeldine »

Hi,

i'm having a problem where I want to have a page break between two toggles. When i just add a break normally, it creates a blank line, and thus a gap between my toggles that i don't want.
I tried to create a Page Break style that sets the font size of 1pt and 0 space before or after the paragraph, but i still get a bit of a gap.
My next though was to wrap the page break in conditional tags set to IF NOT CHM, HTML so that the break would be hidden from .chm and web help files and appear in PDFs and custom PDF builds, however, H&M seems to be ignoring the page break no matter what the build is. Is this something that can be fixed easily and /or worked around?

Thanks, Mark
User avatar
Tim Green
Site Admin
Posts: 23156
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: Page breaks in conditional tags

Unread post by Tim Green »

Hi Mark,

This is a bit of a problem because a page break is always also a paragraph. This is OK in normal paragraphs but after a table or toggle it's difficult because then you have an additional paragraph. I've asked our developers to look into it. (You could make two different versions of the toggle pair, one with a page break between them and one without, but that would be annoying to maintain...)
Regards,
Tim (EC Software Documentation & User Support)

Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
Mark_Hazeldine
Posts: 102
Joined: Fri Jan 15, 2010 6:16 pm
Location: London, UK

Re: Page breaks in conditional tags

Unread post by Mark_Hazeldine »

Hi Tim,

thanks for looking into it. Making two different versions would definitely not be a great solution. For a start my project is now at 1400 pages, so....yeah...no! lol
In an ideal world, it would be nice if page breaks were "invisible" to non print formats (i.e. they didn't create a blank line), but I could live with wrapping them in tags if that was the only solution.

Thanks, Mark
User avatar
Tim Green
Site Admin
Posts: 23156
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: Page breaks in conditional tags

Unread post by Tim Green »

Hi Mark,

Update: This is actually possible, it's just not very obvious how you need to do it. The key is knowing that the page break is an attribute applied to paragraph that comes after the break. In the XML source it's called page-break-before:always;. So what you need to do is position the cursor directly in front of the element that is going to come after the break, then it will work. In the case of a toggle this means that the cursor should be directly to the left of the toggle icon, or the toggle link if there is no icon. In the case of a table it should be directly to the left of the table -- i.e. put the cursor right at the beginning of the first cell of the table, then press the left arrow key once to move it just outside the table. Then it will work. 8)
Regards,
Tim (EC Software Documentation & User Support)

Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
Mark_Hazeldine
Posts: 102
Joined: Fri Jan 15, 2010 6:16 pm
Location: London, UK

Re: Page breaks in conditional tags

Unread post by Mark_Hazeldine »

Tim,

thanks for that very useful tip! It seems to work...soft of. Basically, i did exactly as you said, and it removes the gap in my chm output, however, only half of my page breaks are working in the PDF.

All my toggles have an icon that is conditionally tagged. And some of them have an anchor before the toggle icon (which is not conditionally tagged, for obvious reasons).
It seems that where the page break precedes an anchor then it works fine, but where there is no anchor, the conditional tag must be excluding the page break too.

This xml code does work:
<para styleclass="HeadingToggle" style="page-break-before:always;"><anchor id="TransferContract" styleclass="HeadingToggle"><keywords><keyword translate="true">Novate CDS</keyword><keyword translate="true">Transfer CDS</keyword><keyword translate="true">Transfer default swap</keyword><keyword translate="true">Novate default swap</keyword></keywords></anchor><conditional-text type="IF" value="CHM,HTML"/><image src="hmtoggle_plus0.gif" scale="100.00%" styleclass="HeadingToggle"></image><conditional-text type="END"/><text styleclass="HeadingToggle" translate="true">&#32;</text><toggle type="dropdown" print-expanded="true" help-expanded="false" defaultstyle="false" translate="true" src-collapsed="hmtoggle_plus0.gif" src-expanded="hmtoggle_plus1.gif" styleclass="HeadingToggle"><caption translate="true"><![CDATA[Transferring a contract to another counterparty]]></caption><title translate="true">Transferring a contract to another counterparty</title></toggle></para>

This xml code doesn't work:
<para styleclass="HeadingToggle" style="page-break-before:always;"><conditional-text type="IF" value="CHM,HTML"/><image src="hmtoggle_plus0.gif" scale="100.00%" styleclass="Normal"></image><conditional-text type="END"/><text styleclass="Normal" translate="true">&#32;</text><toggle type="dropdown" print-expanded="true" help-expanded="false" defaultstyle="false" translate="true" src-collapsed="hmtoggle_plus0.gif" src-expanded="hmtoggle_plus1.gif" styleclass="HeadingToggle"><caption translate="true"><![CDATA[Required/additional fields]]></caption><title translate="true">Required/additional fields</title></toggle></para>

Thanks, Mark
User avatar
Tim Green
Site Admin
Posts: 23156
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: Page breaks in conditional tags

Unread post by Tim Green »

Hi Mark,

The problem here is that the page break attribute is "glued" to the first item in the paragraph, no matter what it is. If that item is removed on publishing it's assumed that the page break's reason for existing has also been removed, so that goes too. In this case you need to "protect" your page break by making a non-removable item the first item in the line. A dummy anchor (or even one you need) is ideal for that. :)
Regards,
Tim (EC Software Documentation & User Support)

Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
Mark_Hazeldine
Posts: 102
Joined: Fri Jan 15, 2010 6:16 pm
Location: London, UK

Re: Page breaks in conditional tags

Unread post by Mark_Hazeldine »

Hi Tim,

I had a feeling you were going to say something like that. That's about the only idea that I had myself. I guess it'll do for now but it's not the most elegant solution!

Thanks anyway, Mark
Post Reply