Xref Print vs Online

This forum is for all Flare issues related to styles, stylesheets and XML.
Post Reply
Christina
Propeller Head
Posts: 64
Joined: Wed Jul 29, 2015 2:59 pm

Xref Print vs Online

Post by Christina »

I just viewed the video of Neil Perlin's presentation about MadCap Flare link options.

http://www.madcapsoftware.com/demos/pla ... dc0cd5f15d

I had to miss the live presentation on account of snow, otherwise I would have asked the following question:

Neil stated that the Xref is good to use within a document project, which is how I've been using it. (Hyperlinks are better for when going outside projects.)

He also said that online the format says the name of the link that you entered, but in print it will show the page number, or if very close, it will say "on the next page" or "below," etc.

However, I'm looking at my project and tested it, and it doesn't do any such thing. Currently I've got this code:

"{paratext}" on page {page}

which means it's intended for print. I can make it for online, or I can make it for print, but how do I get the Xref to do both?

Or should I just email Neil and ask him directly?
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: Xref Print vs Online

Post by LTinker68 »

You need to use mediums in your stylesheet to differentiate how the style appears in online (web) output versus print output. If you have your Stylesheet Editor set to the Advanced view, then in the middle top area of the stylesheet GUI you'll see a drop-down that says Medium: (default). If you make changes to the stylesheet while it shows that, then you're changing the default medium, which is what you (IMHO) should use for online output. If you click the drop-down and select Medium: print, then any changes you make to the styles will be added to the print medium of the stylesheet. Save the stylesheet after making the changes, then if you want to see how it appears in the actual stylesheet file, open the stylesheet file in the Internal Text Editor. When you scroll down, you'll see a group of styles encased inside a block labeled @media print. Any styles not contained within the opening { and final } of that media block will be part of your default (web) medium. You can create multiple mediums; any styles defined for those mediums will appear within a @media block that matches the name of the medium.

Note that if you then modify a default medium style after modifying some print medium styles, then those default medium styles might appear in the stylesheet file after the @media print block. That's because new default medium style definitions are always added to the bottom of the file, while new named medium style definitions are always added to the bottom of the @media block.

For example, the first style below is in the default (online) medium. The second one is inside the print medium, so you can see how the xref text changes depending on which output I build. This is just a snippet of my stylesheet file, but you get the idea. (I forgot to mention that you also specify in the target which stylesheet medium to use for that output.)

Code: Select all

MadCap|xref.context
{
	mc-format: '{paratext}';
}

@media print
{
	MadCap|xref.context
	{
		mc-format: '{i}{paratext}{/i} {pageref}';
	}
}
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
Christina
Propeller Head
Posts: 64
Joined: Wed Jul 29, 2015 2:59 pm

Re: Xref Print vs Online

Post by Christina »

Thank you, I just managed to stagger through this; you make sure of your medium - Default for Online, and Print for PDF.

Also, I figured out that I have to Save before the changes take place. So thank you for confirming for me how this is done.

I tested it and it doesn't work.

When I am in a topic and pick Layout (WEB) and Medium Default, and then add an Xref, it looks great when I preview in Online.

When I switch to the Layout (Print) and Medium Print - the page number does not show up.

Here is my format for Online:

{color blue}{i}{u}{paratext}{/u}{/i}{/color}

Here is my format for Print:

{i}{paratext}{pageref} {/i}


What setting am I missing?
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: Xref Print vs Online

Post by LTinker68 »

I don't think it will show up in preview because the preview doesn't know yet how many pages your output is going to be so it can't resolve the page number. If you generate the print output then does it show up?
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
Christina
Propeller Head
Posts: 64
Joined: Wed Jul 29, 2015 2:59 pm

Re: Xref Print vs Online

Post by Christina »

Also, I get what you're saying in that different parts of the code need to be inside or outside of the bracket. But when you say:

"open the stylesheet file in the Internal Text Editor. "

I got a little lost. I am in the Stylesheet Editor, but don't know how to open the "stylesheet file" (which is what?) in the Text Editor.
Christina
Propeller Head
Posts: 64
Joined: Wed Jul 29, 2015 2:59 pm

Re: Xref Print vs Online

Post by Christina »

It did show up one time; it used "1" as the page number. Then I thought I had it figured out, but can't make it work again.
doc_guy
Propellus Maximus
Posts: 1979
Joined: Tue Nov 28, 2006 11:18 am
Location: Crossroads of the West
Contact:

Re: Xref Print vs Online

Post by doc_guy »

If you right-click the stylesheet file in your project, you have an option to "Open With >" and then "Internal Text Editor.

That lets you edit the CSS code directly, rather than in the Stylesheet Editor.

Actually try generating the output and see if the page numbers are there in the output. Or you can try switching the layout to Print, and then going to the Tools ribbon, and then clicking "Update Cross References" in the Update section.

Basically, Flare builds the content you see in the XML Editor when you insert the cross reference, depending on the Layout that is selected. If the layout is Print, then it will insert it with a dummy page number (1). If the layout is Online, then it will insert it without the page number. Flare DOES NOT redraw this when you switch between layouts, but it WILL generate correctly when Flare builds the output. You can force the page you are on to redraw the cross reference format by clicking the Update Cross-References button.

So this is another case of "What you see is sorta-related to what you might get" in the XML Editor.
Paul Pehrson
My Blog

Image
Post Reply