Home Forums DITA and XMetaL Discussion TOPLEAF: Cross-references do not include page numbers Reply To: TOPLEAF: Cross-references do not include page numbers


Reply to: TOPLEAF: Cross-references do not include page numbers

I should point out that the [u]Idref[/u] package you are using won't be officially released until the XMetaL 7 version of the plugin (real soon now), but here's a sneak preview.

Assuming the target element has an id attribute, you “register” the target with either:

  • if the element is a topic (concept, task etc); or
  • if the element is within a topic (eg. a section).

This creates a unique target from the filename and ID which (in the case of the first topic in a file) can also be reached using just the filename. It also allows you to set any number of “properties” associated with this target. These are just named strings that can be retrieved when needed. For example you could save the title of a target, then retrieve it whenever you make an xref to that target. So the text of the link is effectively self generating.

However, you also get a folio (ie. page number) property for free (you don't have to set it yourself). This can be used as follows:

    on page {Idref-folio}

where Idref-GetP retrieves the property PROP associated with the target and assigns it to the variable {Idref-PROP}.

Let me know if this works, because if it doesn't I need to make an urgent fix to the XMetaL 7.0 plugin 😉