Skip to content

Link attribute no longer rendering #832

@mingard

Description

@mingard

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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions