[MGNLUI-6708] DOC: Setting default values for preconfigured link fields Created: 20/May/21  Updated: 21/Jun/21  Resolved: 18/Jun/21

Status: Closed
Project: Magnolia UI
Component/s: None
Affects Version/s: 6.2.9
Fix Version/s: None

Type: Task Priority: Neutral
Reporter: Ashraf Khamis Assignee: Ashraf Khamis
Resolution: Done Votes: 0
Labels: fields, linkfield
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
documentation
documents MGNLUI-6603 defaultValue for preconfigured link f... Closed
Template:
Acceptance criteria:
Empty
Task DoR:
Empty
Epic Link: Improve Content Linking
Sprint: UI FW 30
Story Points: 2

 Description   

After MGNLUI-6375, you can set defaultValue for preconfigured link fields as follows:

pageLinkField

Set a path or UUID (like for the JCR link field).

pageLinkPath:
  $type: pageLinkField
  defaultValue: /travel
pageLinkUUID:
  $type: pageLinkField
  defaultValue: 53b073cc-ea3a-4e44-bdea-8c8a790b55c5

damLinkField

Set a UUID with a prefix.

damLinkUUID:
  $type: damLinkField
  defaultValue: jcr:baa86f2d-b1c6-413e-9879-bc2b166f9f1d

jsonLinkField

Set a string value.

jsonLink:
  $type: jsonLinkField
  defaultValue: Andorra
  chooser:
    workbenchChooser:
      datasource:
        $type: jsonDatasource
        restClient: countries
        restCall: allCountries
        jsonPathExpressions:
          itemId: '$.name'
          items: '$.*'
          describeBy: '$.name'
          properties:
            name: '$.name'
      workbench:
        contentViews:
          - name: list
            $type: listView
            columns:
              - name: name
                label: Name


 Comments   
Comment by Ashraf Khamis [ 18/Jun/21 ]

Added the following section about setting default values for link fields: https://docs.magnolia-cms.com/product-docs/6.2/Templating/Dialog-definition/Field-definition/List-of-fields/Link-field.html#_default_values_for_preconfigured_link_fields.

Reviewed by Roman.

Generated at Mon Feb 12 09:39:12 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.