Suppress Page Number in CrossRef

Post here questions and problems related to editing and publishing DITA content.
IsleofGough
Posts: 34
Joined: Fri Dec 02, 2016 9:55 pm

Suppress Page Number in CrossRef

Post by IsleofGough »

I would like to suppress the page numbering in cross-references in the HTML/CSS pdf target so that I can use these as endnotes (where more than one cross-reference may go to the same endnote). I created a custom CSS:

Code: Select all

*[class ~= "topic/xref"][href]:after,
*[class ~= "topic/link"][href]:after {
    content: none;
}
I set the target to use this custom CSS but it still generates page numbers (see attachment). What am I missing? Also, is there a way of just suppressing page numbers in some cross refs but not others, so I can use both cross refs as endnotes and as cross-references to page numbers in other topic files?
Image
Attachments
CustomCSS.jpg
CustomCSS.jpg (164.77 KiB) Viewed 192 times
julien_lacour
Posts: 344
Joined: Wed Oct 16, 2019 3:47 pm

Re: Suppress Page Number in CrossRef

Post by julien_lacour »

Hello,

If you want to remove the "on page X" label for all the links you can directly use the 'args.css.param.show-onpage-lbl' DITA parameter (available when editing DITA scenario).

If you want to remove the label only for a few links you can mark them with an outputclass, for example <xref keyref="genus" format="dita" outputclass="no-label">genus</xref> and then match this outputclass in the CSS, like this:

Code: Select all

/* Links. */
*[class ~= "map/map"] *[class ~= "topic/xref"][outputclass ~= "no-label"][href]:after,
*[class ~= "map/map"] *[class ~= "topic/link"][outputclass ~= "no-label"][href]:after {
  content: none;
}
You can also use any of the other attributes available in the element (like @href, @scope or @format), but in order to give you a relevant example I will need an example.

Regards,
Julien
IsleofGough
Posts: 34
Joined: Fri Dec 02, 2016 9:55 pm

Re: Suppress Page Number in CrossRef

Post by IsleofGough »

Perfect!
Post Reply