Previous versions of Publish supported the publish.display.link attribute, which accepted a pattern that contained {value} such as https://somedomain.com/path/to/{value} which would use the value of the field to replace the placeholder.
|
const {display = {}, multiline, readonly, resizable, rows} = publishBlock |
|
const link = formatLink(value, display.link) |
|
export default function formatLink(value, displayDirective) { |
|
if (displayDirective && value) { |
|
if (typeof displayDirective === 'string') { |
|
return displayDirective.replace('{value}', value) |
|
} |
|
|
|
return /^https?:\/\//.test(value) ? value : 'http://' + value |
|
} |
|
|
|
return null |
|
} |
The formatLink seems to be returning only the value of the field where previously it would render.
Previous versions of Publish supported the
publish.display.linkattribute, which accepted a pattern that contained{value}such ashttps://somedomain.com/path/to/{value}which would use the value of the field to replace the placeholder.publish/app/components/FieldString/FieldStringEdit.jsx
Lines 230 to 231 in 1bffba5
publish/app/lib/util/formatLink.js
Lines 1 to 11 in c0b1dd3
The formatLink seems to be returning only the value of the field where previously it would render.