Conditional text applied automatically to page numbers?
-
- Propeller Head
- Posts: 18
- Joined: Wed May 20, 2015 2:29 pm
Conditional text applied automatically to page numbers?
I'm single-sourcing my HTML5 output with PDF output. I created a cross reference style that lists the page number along with the term. Here's what I put for the properties:
{color blue}{paratext}{/color} {color black}(page {page})
The end result is something like this: allowFileOpens (page 1)
I've been going back through the lists of terms and manually conditioning the page numbers and their parens for PDF output. But with hundreds of terms this process is tedious at best. Is there a way to indicate in the code above that the page numbers are for PDF output only? Or, is there a better way to do this?
Thanks,
Karen
{color blue}{paratext}{/color} {color black}(page {page})
The end result is something like this: allowFileOpens (page 1)
I've been going back through the lists of terms and manually conditioning the page numbers and their parens for PDF output. But with hundreds of terms this process is tedious at best. Is there a way to indicate in the code above that the page numbers are for PDF output only? Or, is there a better way to do this?
Thanks,
Karen
Re: Conditional text applied automatically to page numbers?
Hi Karen,
You are on the right track. The solution is to create different cross reference text for the different mediums in your style sheet:
For example:
You are on the right track. The solution is to create different cross reference text for the different mediums in your style sheet:
For example:
Code: Select all
@media print
{
MadCap|xref
{
mc-format: '{color blue}{paratext}{/color} {color black}(page {page}{/color})';
}
}
@media non-print
{
MadCap|xref
{
mc-format: '{color blue}{paratext}{/color})';
}
}
Last edited by Paulie on Mon Sep 21, 2015 12:18 pm, edited 1 time in total.
"In an ideal world, software should be simple, well designed, and completely intuitive to end users. In the real world, good documentation is king."
-
- Senior Propellus Maximus
- Posts: 2634
- Joined: Wed Apr 14, 2010 8:01 am
- Location: Surrey, UK
Re: Conditional text applied automatically to page numbers?
Don't you have to have {/color} after your page number?
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
Report bugs at http://www.madcapsoftware.com/bugs/submit.aspx.
Request features at https://www.madcapsoftware.com/feedback ... quest.aspx
Re: Conditional text applied automatically to page numbers?
I would have thought so. I've added the extra tag to the above suggestion.ChoccieMuffin wrote:Don't you have to have {/color} after your page number?
"In an ideal world, software should be simple, well designed, and completely intuitive to end users. In the real world, good documentation is king."
-
- Propeller Head
- Posts: 18
- Joined: Wed May 20, 2015 2:29 pm
Re: Conditional text applied automatically to page numbers?
Thanks everyone for your great ideas! But I have a question about the code example: the print example shows the two colors being used (blue and black), but doesn't appear to address the conditional text issue. Is there additional code I can use to make the page numbers conditional for print only?
Thanks!
Thanks!
-
- Senior Propellus Maximus
- Posts: 3671
- Joined: Thu Feb 02, 2006 9:57 am
- Location: Pittsford, NY
Re: Conditional text applied automatically to page numbers?
You don't need to do conditioning whatsoever. It's the format of the particular MadCap|xref style as defined in the stylesheet. You online output will use the format defined in the default medium (which I assume is the medium associated with your online targets), while your PDF output will use the format defined in the medium you use for your PDF targets.
Nita
RETIRED, but still fond of all the Flare friends I've made. See you around now and then!
RETIRED, but still fond of all the Flare friends I've made. See you around now and then!
-
- Propeller Head
- Posts: 18
- Joined: Wed May 20, 2015 2:29 pm
Re: Conditional text applied automatically to page numbers?
Nita,
All I can say is "duh." Of course I can include the page number in my print style and not in my online style!
Thanks a million!
All I can say is "duh." Of course I can include the page number in my print style and not in my online style!
Thanks a million!
-
- Senior Propellus Maximus
- Posts: 3671
- Joined: Thu Feb 02, 2006 9:57 am
- Location: Pittsford, NY
Re: Conditional text applied automatically to page numbers?
No worries, Karen. I have "Duh!" and "Doh!" moments every week! Glad we all got you squared away.
Nita
RETIRED, but still fond of all the Flare friends I've made. See you around now and then!
RETIRED, but still fond of all the Flare friends I've made. See you around now and then!
Re: Conditional text applied automatically to page numbers?
To beat this a little further to death, I have a xref called "on page" which inserts " on page #":
MadCap|xref.on-page
{
mc-format: ' on page {page}';
color: #000000;
text-decoration: none;
}
I wanted it conditionaled for print automatically so I can quit having to flag it manually every time. On the advice above, I found it in my CSS and moved it into the Print medium section. Easy! I have nothing for on-page in my Web medium. But when I build for Web, instead of disappearing, it renders as the topic name . Instead of "See (topic) on page #", I get:
See Get started - Ev-LocalGet started - Ev-Local.
where "Get started - Ev-Local" is the topic title. The first one is correct. The second one is supposed to be the " on page #" that drops out. Not only is it not dropping out, it's rendering wrong. This is in my local output, before it even gets mangled by Salesforce . It builds like it should for PDF. Super appreciate any help with this!
MadCap|xref.on-page
{
mc-format: ' on page {page}';
color: #000000;
text-decoration: none;
}
I wanted it conditionaled for print automatically so I can quit having to flag it manually every time. On the advice above, I found it in my CSS and moved it into the Print medium section. Easy! I have nothing for on-page in my Web medium. But when I build for Web, instead of disappearing, it renders as the topic name . Instead of "See (topic) on page #", I get:
See Get started - Ev-LocalGet started - Ev-Local.
where "Get started - Ev-Local" is the topic title. The first one is correct. The second one is supposed to be the " on page #" that drops out. Not only is it not dropping out, it's rendering wrong. This is in my local output, before it even gets mangled by Salesforce . It builds like it should for PDF. Super appreciate any help with this!
-
- Propellus Maximus
- Posts: 613
- Joined: Wed Feb 01, 2006 6:21 am
- Location: Off in the dark....
Re: Conditional text applied automatically to page numbers?
Slight misunderstanding, there.
Flare always outputs everything, even if a style or class is invalid. Flare just displays it with default formatting. If you want to be rid of that line in your online output, you'll need to exclude it with a condition.
Flare always outputs everything, even if a style or class is invalid. Flare just displays it with default formatting. If you want to be rid of that line in your online output, you'll need to exclude it with a condition.
Trent.
Certifiable.
umm...
I meant MAD Certified.
Official Propeller Beanie Owner
Are you on Flare's Slack channels? PM me for an invitation!
Certifiable.
umm...
I meant MAD Certified.
Official Propeller Beanie Owner
Are you on Flare's Slack channels? PM me for an invitation!