configureAsInlineLink

Type: Function

How to get configureAsInlineLink?

JavaScript

import configureAsInlineLink from 'fontoxml-families/src/configureAsInlineLink.js'

Configures a link to a resource.

Links are displayed in blue, underlined text. A popover can be configured for an inline link using CvkOptions to display more information about the link when clicking it, and to provide means to edit it and navigate to its target.

Being a variation of inline frame, inline links can’t be split in two and adjacent ones will not merge. Inline links can be deleted by pressing backspace or delete twice: the first keypress selects the link to help the author understand what will happen.

Use this family for e.g. links internal to a document, to other documents, and to web addresses.

The links may be represented by a permanent id or a non-permanent id. By setting the option isPermanentId to true, the result of the referenceQuery option is interpreted as a permanent id, which will be resolved.

The following visualization options are visualized by this family:

  • baseline

  • fontStack

  • isMonospaced

The following widget areas are available:

  • inlineBefore

  • inlineAfter

This family has a number of additional options which affect how it behaves:

  • defaultTextContainer

  • isPermanentId

  • referenceQuery

Example

JavaScript

// Configure a DITA web reference, using a popover provided by the web
// references add-on and an edit operation provided by the DITA add-on.
configureAsInlineLink(sxModule, 'self::xref[@format="html"]', 'hyperlink', {
	emptyElementPlaceholderText: 'type the link text',
	isPermanentId: false, // Set to 'true' to enable reference resolving.
	popoverComponentName: 'WebReferencePopover',
	popoverData: {
		editOperationName: 'dita-web-reference-edit',
		targetIsPermanentId: false, // Set to 'true' to enable reference resolving.
		targetQuery: '@href'
	},
	referenceQuery: '@href'
});

Deprecation

For backwards compatibility, the fourth argument of this function may be an attribute name or a nullish value instead of CvkOptions. The fifth argument can then be used for providing CvkOptions. If an attribute name is provided as fourth argument, the use of permanent ids is assumed.

This behavior is deprecated and will be unsupported from Fonto 7.16 onwards. The additional CvkOptions isPermanentId and referenceQuery should be used instead. Please refer to the deprecation announcement for more details.

Arguments

  1. sxModule

    (Required)

    Type: SxModule

  2. selector

    (Required)

    Type: XPathTest

  3. markupLabel

    (Required)

    Type: String

  4. optionsOrReferenceAttributeName

    (Required)

    Type: CvkOptions | String | NULL

    The options, or the name of the attribute holding the permanent id referenced by the link.

    Properties

  5. oldOptionsParameter

    (Optional)

    The options when a reference attribute name or a nullish value is provided as fourth argument.