How to create a "page 1 of 1" variable[FIXED]

This forum is for all Flare issues not related to any of the other categories.
Post Reply
M33R4
Sr. Propeller Head
Posts: 128
Joined: Wed Oct 07, 2020 7:58 am
Location: UK

How to create a "page 1 of 1" variable[FIXED]

Post by M33R4 »

Help needed please to create a page variable that will automatically display what page (of ? total pages in document) the User is on :?:
Last edited by M33R4 on Wed Oct 06, 2021 8:09 am, edited 3 times in total.
Newbie to MadCap Flare
ChoccieMuffin
Senior Propellus Maximus
Posts: 2630
Joined: Wed Apr 14, 2010 8:01 am
Location: Surrey, UK

Re: How to create a "page number" variable

Post by ChoccieMuffin »

Can you clarify what output you're talking about, please?
Started as a newbie with Flare 6.1, now using Flare 2023.
Report bugs at http://www.madcapsoftware.com/bugs/submit.aspx.
Request features at https://www.madcapsoftware.com/feedback ... quest.aspx
M33R4
Sr. Propeller Head
Posts: 128
Joined: Wed Oct 07, 2020 7:58 am
Location: UK

Re: How to create a "page number" variable

Post by M33R4 »

ChoccieMuffin wrote:Can you clarify what output you're talking about, please?
Output = Print

On my A4 PageLayout, at the bottom of my right and left pages, I have a frame that contains a page number footer within which sits a variable called System.PageNumber

I wish to replace this SystemPageNumber with a page number variable which displays which page of how many total pages the User is currently viewing.
Newbie to MadCap Flare
robdocsmith
Sr. Propeller Head
Posts: 247
Joined: Thu May 24, 2018 3:11 pm
Location: Queensland, Australia

Re: How to create a "page 1 of 1" variable

Post by robdocsmith »

The System.PageCount variable will give you a total page count for the document. I use:

Code: Select all

<xhtml:p xhtml:class="footer"><MadCap:variable xhtml:name="System.PageNumber" /> of <MadCap:variable xhtml:name="System.PageCount" /></xhtml:p>
in my Footer frame of the page layout.

See https://help.madcapsoftware.com/flare20 ... iables.htm for more info on what system variables are available.

cheers,
Rob
M33R4
Sr. Propeller Head
Posts: 128
Joined: Wed Oct 07, 2020 7:58 am
Location: UK

Re: How to create a "page 1 of 1" variable

Post by M33R4 »

robdocsmith wrote:..... I use:

Code: Select all

<xhtml:p xhtml:class="footer"><MadCap:variable xhtml:name="System.PageNumber" /> of <MadCap:variable xhtml:name="System.PageCount" /></xhtml:p>
in my Footer frame of the page layout....
cheers,
Rob
Hi Rob.

Where do I insert this code please? I've tried replacing my current code (shown below) with yours but Flare tells me the Document is not valid.

I have my page number in a table row as follows:


<td style="font-size: 10pt;font-family: Calibri;line-height: 12pt;text-align: right;vertical-align: top;padding-left: 0px;padding-right: 0px;padding-top: 0px;padding-bottom: 0px;">
<p style="font-size: 10pt;font-family: Calibri;font-weight: normal;text-align: right;"> </p>
<p style="font-size: 10pt;font-family: Calibri;font-weight: normal;text-align: right;">Page: <MadCap:variable name="System.PageNumber" style="font-size: 10pt;" /> </p>
</td>

Many thanks.
Newbie to MadCap Flare
robdocsmith
Sr. Propeller Head
Posts: 247
Joined: Thu May 24, 2018 3:11 pm
Location: Queensland, Australia

Re: How to create a "page 1 of 1" variable

Post by robdocsmith »

Ahh my apologies.

In your case, your last line should be:

Code: Select all

<p style="font-size: 10pt;font-family: Calibri;font-weight: normal;text-align: right;">Page: <MadCap:variable name="System.PageNumber" style="font-size: 10pt;" /> of <MadCap:variable name="System.PageCount" style="font-size: 10pt;" /></p>
See https://help.madcapsoftware.com/flare20 ... e%20layout for information on page layouts. That's for the latest Flare, but most will apply to older versions if you have one of those.

It would be better to create a footer class in your stysheet that has the charactistics you want instead of local formatting:

Code: Select all

p.footer {font-size: 10pt;font-family: Calibri;font-weight: normal;text-align: right;}
then your footer table would include:

Code: Select all

<p class="footer">Page: <MadCap:variable name="System.PageNumber" /> of <MadCap:variable name="System.PageCount" /></p>
Cheers,

Rob
Post Reply