Cross Reference in footer of Page Layout not working

This forum is for all Flare issues related to PDF, eBook, Microsoft Word, Adobe FrameMaker, XPS, and XHTML book targets.
Post Reply
kyrempel
Jr. Propeller Head
Posts: 3
Joined: Mon Mar 09, 2015 7:06 pm

Cross Reference in footer of Page Layout not working

Post by kyrempel »

Hi all, first post here...

I added a cross reference in the footer of my page layout, using the Cross Reference button on the ribbon. This is the code MCF inserted:
<MadCap:xref xhtml:href="../../LPFL/1-Front Matter/TOC.htm" xhtml:class="TopicTitle" xmlns:MadCap="http://www.madcapsoftware.com/Schemas/MadCap.xsd">TABLE OF CONTENTS</MadCap:xref>

The PDF builds okay, and references within the body frame of my topics open the link to the TOC.

But the footer cross reference causes this error message:
Adobe Reader
Could not open the file '../../../../../../../Content/LPFL/1-Front Matter/TOC.htm'.

I haven't been able to find any other posts on problems with cross references in the footer. Any ideas?

Thanks!
Karen :?
kwag_myers
Propellus Maximus
Posts: 810
Joined: Wed Jul 25, 2012 11:36 am
Location: Ann Arbor, MI

Re: Cross Reference in footer of Page Layout not working

Post by kwag_myers »

I've never had a need for using Cross References, but my understanding of the intent is like a snippet for a link. So, I have to ask the question, why would you put one in a page layout? To me, you're using a repeating object (Cross Reference) inside a repeating object (Page Layout). Have you tried using a link instead?

Looking at the error, whenever you have ../ in a link, you're telling the browser (or in this case, the reader software) to go up one folder level. It looks to me like the reader is being sent to the parking lot to look for TOC.htm. Which is another thing, why would a PDF be looking for an HTML? Since there aren't that many folder levels in a Flare output, I think Flare is just totally confused.
"I'm tryin' to think, but nothin' happens!" - Curly Joe Howard
kyrempel
Jr. Propeller Head
Posts: 3
Joined: Mon Mar 09, 2015 7:06 pm

Re: Cross Reference in footer of Page Layout not working

Post by kyrempel »

Hi Kwag,

Thanks for the tip. The weird series of deepening folders is something MCF put in the PDF when I built the target; it wasn't that way in my original code. I think you are right about MCF being confused. Funny about the parking lot. :)

I haven't tried a hyperlink because it is to a location within the same document, so theoretically a cross-reference is the right thing to use.

My client wanted me to put the link to the table of contents at the bottom of every page--ie, in the footer. That's why I'm doing it--duplicating a doc they set up in InDesign, but using MCF instead.

But since the link does point to the .htm topic file (which isn't going to work in the generated PDF), I'm going to try using a bookmark instead.

BTW, MadCap Tech Support has logged a bug for the issue. So they did expect MCF to be able to translate the link into something that works!

Karen
Nita Beck
Senior Propellus Maximus
Posts: 3667
Joined: Thu Feb 02, 2006 9:57 am
Location: Pittsford, NY

Re: Cross Reference in footer of Page Layout not working

Post by Nita Beck »

Karen, on your behalf, I tried to find a workaround, but I've come up short. I think this is a Flare shortcoming, so definitely submit a feature request/bug report (assuming one hasn't already been submitted).

Now I'd like to address a few misconceptions expressed in this thread.

First, it is perfectly OK to use a hyperlink to another location within the same document.

Second, the intent of a cross-reference is not to act "like a snippet for a link." Although it's fine to put a cross-reference in a snippet and then drop that snippet in where needed, the snippet is not necessary, as one can easily insert a cross-reference wherever needed.

A cross-reference is a specialized form of a link, and in my practice and that of many others, a cross-reference is preferable to a hyperlink in most circumstances. In fact, as of Flare 11, the default action now for dragging a topic from the Content Explorer into a topic in the XML Editor will result in a cross-reference, not a hyperlink. (That default is user-definable, for those who like the old action.) The only circumstances in which I continue to use hyperlinks is when linking to websites or files external to the Flare project.

Cross-references are superior to hyperlinks in many ways. For one, the human-readable text of the cross-reference will always match the first heading in the destination topic to which it points. So say a cross-reference points to a topic whose first reading reads "Care and feeding of cats", and then say that that destination topic is edited so the heading now reads "Care and feeding of kittens and cats". When output is generated, every cross-reference to that destination topic will show "Care and feeding of kittens and cats", without the Flare author having to update any of them. This is not true of a hyperlink, for which, whatever the text of the link, that shall be the text always, unless the Flare author deliberately edits it.

Another advantage of using cross-reference is that the Flare author can define a variety of formats for how a cross-reference will be rendered, depending on the output. For example, in many of my projects, I style a cross-reference in print output to be formatted (not the actual Flare coding, by the way) as "Topic heading" (page x), so I can end up with passages such as these:

For more information, see "Care and feeding of kittens and cats" (page 5).
See "Care and feeding of kittens and cats" (page 5).
Techniques for feeding very young kittens with a dropper are covered in "Care and feeding of kittens and cats" (page 5).

But I format the same cross-references in online output to mimic hyperlinks, so they will look like this:

For more information, see Care and feeding of kittens and cats.
See Care and feeding of kittens and cats.
Techniques for feeding very young kittens with a dropper are covered in Care and feeding of kittens and cats.

In any case, I encourage all Flare users who are not using cross-references as a standard part of their practice to consider making the switch. Detailed coverage is here:

http://webhelp.madcapsoftware.com/flare ... rences.htm
http://docs.madcapsoftware.com/FlareV11 ... sGuide.pdf, particularly Chapter 4.

Lastly, the full Analyzer product has a feature that suggests opportunities for cross-references. I haven't used that feature myself (because I use cross-references by habit), but as I understand it, it helps to identify hyperlinks that could be reworked as cross-references. It doesn't do that rework automatically, but it at least identifies opportunities.
Nita
Image
RETIRED, but still fond of all the Flare friends I've made. See you around now and then!
LLawver
Jr. Propeller Head
Posts: 1
Joined: Mon May 16, 2016 12:56 pm

Re: Cross Reference in footer of Page Layout not working

Post by LLawver »

Checking in on this thread to see if there was ever a resolution or if anything has changed?

Until today I haven't had the need to create a forum account because all of my questions have been answered in various threads (very thankful for this forum), but this one has me stumped. I'm looking to do exactly what kyrempel was trying to do: put a "Return to TOC" link at the bottom of every page in my PDF output. I thought the page layout was the way to go, but that doesn't seem to work. Any other ideas?
hferguson
Propeller Head
Posts: 57
Joined: Fri Jun 15, 2012 9:39 am

Re: Cross Reference in footer of Page Layout not working

Post by hferguson »

Hi all - I am also having this problem - there has never been a resolution posted to this thread. Is there something out there someone knows of that allows me to link back to the TOC topic from the footer of every page?
Nita Beck
Senior Propellus Maximus
Posts: 3667
Joined: Thu Feb 02, 2006 9:57 am
Location: Pittsford, NY

Re: Cross Reference in footer of Page Layout not working

Post by Nita Beck »

hferguson wrote:Hi all - I am also having this problem - there has never been a resolution posted to this thread. Is there something out there someone knows of that allows me to link back to the TOC topic from the footer of every page?
To the best of my knowledge, there is still no resolution.
Nita
Image
RETIRED, but still fond of all the Flare friends I've made. See you around now and then!
CatVancouver
Propeller Head
Posts: 13
Joined: Wed Oct 26, 2011 1:20 pm

Re: Cross Reference in footer of Page Layout not working

Post by CatVancouver »

Has someone posted a bug for this? I also need to have it working now, thanks!
Bahbert
Propeller Head
Posts: 46
Joined: Wed May 13, 2009 2:16 pm

Re: Cross Reference in footer of Page Layout not working

Post by Bahbert »

I'm also encountering this issue now. A fix would be helpful! Anyone found a workaround?
MeganTR
Jr. Propeller Head
Posts: 4
Joined: Tue Feb 20, 2018 4:58 pm

Re: Cross Reference in footer of Page Layout not working

Post by MeganTR »

Sorry to bump an old post, but I am also having this issue. I need to put links to specific topics in a page layout and have been coming up with the same error as OP. I've tried both links and x-refs to no avail.

Anyone find a workaround or a solution yet?
ChoccieMuffin
Senior Propellus Maximus
Posts: 2630
Joined: Wed Apr 14, 2010 8:01 am
Location: Surrey, UK

Re: Cross Reference in footer of Page Layout not working

Post by ChoccieMuffin »

Sounds like it's still a bug, so do report it. It seems that the more reports a bug has, the higher up it gets the list of priority for fixing.
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
robdocsmith
Sr. Propeller Head
Posts: 247
Joined: Thu May 24, 2018 3:11 pm
Location: Queensland, Australia

Re: Cross Reference in footer of Page Layout not working

Post by robdocsmith »

I was stumbling on this today too and came up with a kludgy workaround.
I'm converting my company from InDesign to Flare to improve useability and to implement single sourcing.
My current InDesign page layouts include a link to the Contents and Cover pages in the footer for PDF output.
I was disappointed to learn this was still not possible in Flare since I wanted to expand it to include a hotlink
to access the start of each chapter. After some digging you can get it to work if you're happy to do some
fiddling in the PDF output afterwards.

Here's what I did:
  1. Set up named destinations at the top of the files you want to link to. I called mine "Contents" and "Cover". You'll get something like <MadCap:namedDestination name="Contents" /> in the code for the page.
  2. Add links in the footer frame of your page layout(s) to the appropriate document in your project. Don't bother trying to link to a bookmark as it doesn't exist - named destinations are for linking to external files or for PDFs that are part of your project. You'll use the named destination later when editing the link.
  3. Output the file to PDF.
  4. Open the PDF file in Notepad++ (I tried Sublime but it doesn't play nicely with the binary encoding).
  5. Search for the link string in the PDF file. Mine looked like: "<</S/Launch/F(../../../../../../../../../Content/Contents.htm)>>" to link to the Contents.htm file. This is what Flare does by default with these links. In rendering the link in PDF, it thinks the link is to an external file in a relative directory. Your link may vary slightly depending on what sort of link you created in the first place. Mine was a basic "a href" type of link on some text.
  6. Do a replace all, replacing the link string above with the corresponding PDF link "<</D(Contents)/S/GoTo>>" Where Contents is the name of your named destination. This is the sort of code you get if you add a link to a named destination when editing the PDF in Acrobat.
  7. Save the file and test it.
Hope that helps you out of a hole until Madcap add this functionality to Flare itself.
Cheers,

Rob
AngelaHaisley
Jr. Propeller Head
Posts: 1
Joined: Thu Mar 21, 2019 1:51 pm

Re: Cross Reference in footer of Page Layout not working

Post by AngelaHaisley »

Did MadCap ever add some functionality for this? I simply want to put a working "Back to Top" link on each page in a PDF using the Page layout, in the footer frame or a decorator frame or wherever will work. I am able to add a Hyperlink that should point to the Title page, but the link doesn't work once I output to PDF. I'd really rather not have to edit the PDF itself.
robdocsmith
Sr. Propeller Head
Posts: 247
Joined: Thu May 24, 2018 3:11 pm
Location: Queensland, Australia

Re: Cross Reference in footer of Page Layout not working

Post by robdocsmith »

Not in Flare 2019 as yet. I raised another bug about this as it would really be good to have it working within Flare itself. Either hotlinks, cross-references or links to named destinations would be a good thing to have working from page layouts. I deliver PDF to tablets and keyboard-less screens and it's just easier to be able to navigate with a sidebar of buttons instead of having to search or scroll back to the Contents page for navigation.

Cheers,

Rob
ChoccieMuffin
Senior Propellus Maximus
Posts: 2630
Joined: Wed Apr 14, 2010 8:01 am
Location: Surrey, UK

Re: Cross Reference in footer of Page Layout not working

Post by ChoccieMuffin »

I suspect the problem is in the nature of PDFs rather than in Flare specifically. But I also suspect that Madcap haven't done a lot of development on improving whatever bit of magic they use for generating PDFs, as there are quite a few low-level niggles about PDFs not being as good as they could be. Perhaps someone needs to shove a few more chocolate biscuits under the door to the Tech Cupboard where they keep the techies... ;)
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
robdocsmith
Sr. Propeller Head
Posts: 247
Joined: Thu May 24, 2018 3:11 pm
Location: Queensland, Australia

Re: Cross Reference in footer of Page Layout not working

Post by robdocsmith »

I suspect it's a bug in Flare. Output gets created first as a series of HTM files which get rendered into individual PDFs (per section of the document) then stitched together to form the final product. The last stage fixes the cross references and links internal to the document. It looks like the ones for the body of the document get fixed, but not those for the header/footer, so they remain pointing to the ../../../../blah.htm links which Acrobat inevitably thinks are outside of the document. I raised another bug on this issue because it really should work correctly.

In the meantime, I decided that instead of relying on Flare to do it, I use a bit of Python script on the PDF post-build to add in my navigation elements and links to named destinations in the document.

Cheers,
Rob
huptcom
Jr. Propeller Head
Posts: 3
Joined: Tue Aug 08, 2017 2:37 am

Re: Cross Reference in footer of Page Layout not working

Post by huptcom »

robdocsmith wrote: ...
[*]Search for the link string in the PDF file. Mine looked like: "<</S/Launch/F(../../../../../../../../../Content/Contents.htm)>>" to link to the Contents.htm file. This is what Flare does by default with these links. In rendering the link in PDF, it thinks the link is to an external file in a relative directory. Your link may vary slightly depending on what sort of link you created in the first place. Mine was a basic "a href" type of link on some text.
[*]Do a replace all, replacing the link string above with the corresponding PDF link "<</D(Contents)/S/GoTo>>" Where Contents is the name of your named destination. This is the sort of code you get if you add a link to a named destination when editing the PDF in Acrobat.
[*]Save the file and test it.[/list]

Hope that helps you out of a hole until Madcap add this functionality to Flare itself.
Cheers,

Rob

Thanks a lot for the workaround, it worked fine for me. But the respective code section in my PDF file was in a different order:

<</S/GoTo/D(TOCtarget)>> with "TOCtarget" the name of the named destination.
Post Reply