Force Page Break

This forum is for all Flare issues related to styles, stylesheets and XML.
Post Reply
WebHelpppp
Propeller Head
Posts: 78
Joined: Thu Jul 17, 2014 8:08 am

Force Page Break

Post by WebHelpppp »

Hi,
I was wondering how I can force a page break before a paragraph. I've tried various formats of "page-break-before: always;" without any success.
Thanks!
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: Force Page Break

Post by LTinker68 »

First, how have you tried the various formats? By creating a style, setting that attribute, and then applying that style that you want to appear on the next page? Or were you trying an inline style or what?

Second, how much or what type of content follows or precedes that paragraph? I don't know what Flare's priorities are for which content block rules, but it's possible that it can't move the paragraph to the next page because doing so violates some other rule you have set. For example, if the preceding content block has page-break-after set to avoid, then it might be preventing your page-break-before from working. It's kind of hard to say without seeing your code and content.
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
WebHelpppp
Propeller Head
Posts: 78
Joined: Thu Jul 17, 2014 8:08 am

Re: Force Page Break

Post by WebHelpppp »

This seems to be working:

p.pageBreakBefore
{
page-break-before: always;
}
ChoccieMuffin
Senior Propellus Maximus
Posts: 2650
Joined: Wed Apr 14, 2010 8:01 am
Location: Surrey, UK

Re: Force Page Break

Post by ChoccieMuffin »

WebHelpppp wrote:This seems to be working:

p.pageBreakBefore
{
page-break-before: always;
}
In my stylesheet have a global class, .PageBreakBefore (with the same attribute). This means that I can force a page break before any tag that could use it, e.g. h3.PageBreakBefore, p.PageBreakBefore, etc. Global classes appear at the top of your style window, here's a pic of mine.

I believe these are better if you have them at the beginning of your CSS, if you add them manually, but I could be wrong about that. (Anyone who knows better, please speak up!)
You do not have the required permissions to view the files attached to this post.
Started as a newbie with Flare 6.1, now using Flare 2024r2.
Report bugs at http://www.madcapsoftware.com/bugs/submit.aspx.
Request features at https://www.madcapsoftware.com/feedback ... quest.aspx
Keri M
Propeller Head
Posts: 48
Joined: Tue Apr 23, 2013 8:35 am
Location: London

Re: Force Page Break

Post by Keri M »

Hi Choccie,

I've created a global style as you have. Do you apply yours to the dropDownHotspot style, and if so, does it work? I've placed mine at the top of my CSS and added page break before=always, and applied it after inserting a drop-down but it's not working.

Thanks,
Keri
ChoccieMuffin
Senior Propellus Maximus
Posts: 2650
Joined: Wed Apr 14, 2010 8:01 am
Location: Surrey, UK

Re: Force Page Break

Post by ChoccieMuffin »

I haven't used it on drop-downs as I don't use them much. I'll have a play and get back to you.

Just thinking (before playing). Does your dropdown head have a style? So that I can get something reasonably acceptable in printed output I apply a style inside the heading, so that ought to work if you apply your .pagebreakbefore to that heading. Here's an extract from one of my topics. I didn't need to apply .pagebreakbefore because my h3 already has a break before. In your case you might be able to apply a case to the dropDownHead.

Code: Select all

<MadCap:dropDown>
            <MadCap:dropDownHead class="h3">
                <MadCap:dropDownHotspot>This is the heading text</MadCap:dropDownHotspot>
            </MadCap:dropDownHead>
            <MadCap:dropDownBody>
                <p>This is the body of the dropdown</p>
                <p>More text</p>
            </MadCap:dropDownBody>
        </MadCap:dropDown>
Does that help?
Started as a newbie with Flare 6.1, now using Flare 2024r2.
Report bugs at http://www.madcapsoftware.com/bugs/submit.aspx.
Request features at https://www.madcapsoftware.com/feedback ... quest.aspx
dorcutt
Sr. Propeller Head
Posts: 234
Joined: Thu May 15, 2014 12:16 pm

Re: Force Page Break

Post by dorcutt »

In general, based on my primitive understanding, CSS code that is later in the stylesheet has higher priority.

It shouldn't be affecting things unless the page-break-before attribute of that same style happens to be explicitly set differently later in the template, but moving it to the end in general makes it more likely to be applied.
-Dan, Propellerhead-in-training
Keri M
Propeller Head
Posts: 48
Joined: Tue Apr 23, 2013 8:35 am
Location: London

Re: Force Page Break

Post by Keri M »

Sorry, I just saw your response -- thank you. I got it working, but I have to apply my .pagebreakbefore style to the body text of the drop-down. Many thanks!
Post Reply