LinkFieldDefinition renders a text field and a browse button that allow the user to select a node from the configured workspace. The link field is used to select targets inside Magnolia, for example a page to tease. Depending on what you want do with the selected node, the system can create a link to it or display its content on the page.
The link field replaces the
uuidLink controls used in Magnolia 4.5.
In addition to defining the
targetWorkspace to browse, you need to define a target
appName. The target app is responsible for providing a view that is suitable for selecting the target node type. When the target app is a content app, the workbench in the browser subapp is a suitable view and it is used by default. For example, the Contacts app provides a workbench for browsing contacts (
Here is an example link field definition in the
stkTeaserContact component. It is used to select a contact to tease.
You can use all common field properties and the following.
Target app name used to create the content view, for example
All content apps provide a workbench. The workbench view is used as the link target chooser by default. However, you can also provide a choose dialog and provide custom actions. See an example in
|The link field returns the path of the selected node by default. You can convert the path to a UUID with a converter. Optional.|
Any class that implements the IdentifierToPathConverter interface. Examples:
Render a preview of the selected content. The preview component typically displays an image thumbnail and some metadata. Optional.
Any class that implements the ContentPreviewComponent interface. Examples:
Makes the text box displaying the link editable once a target has been selected. Optional.
Button label before the target node is selected. Default is "Select new...", retrieved from a message bundle. Optional.
Button label after the target node is selected. Default is "Select another...", retrieved from a message bundle. Optional.
Name of the workspace in which the target content is stored. Mandatory.
Path where to start browsing the workspace.