-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Description
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.
publish/app/components/FieldString/FieldStringEdit.jsx
Lines 230 to 231 in 1bffba5
| const {display = {}, multiline, readonly, resizable, rows} = publishBlock | |
| const link = formatLink(value, display.link) |
publish/app/lib/util/formatLink.js
Lines 1 to 11 in c0b1dd3
| 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.