Core - Content Link - Display name not working

When creating a Content Link the display name does not show the value only the word you typed in the display name field.

{
link: ‘specifications’,
display: ‘number’,
}

When leaving the field empty it shows the id.

Screenshot 2022-07-26 at 09.50.38

It should be ${data.number} , missing in documentation

example :

1 Like

Thanks!, that worked!

What about field sets? I want to display the content of the field called “favourite-thing”. Putting ${data.favourite-thing} in the Display field returns “n/a” in the form.

In general I wouldn’t recommend to use kebab-case for field names but instead camel case: favouriteThing

But regarding your issue, this should work:

${data['favourite-thing']}

2 Likes

Hi @artur
Thank you very much for your quick answer! This does indeed work :smiley:

Just for future visitors:

If the field name is named with kebab case the solution is: ${data['favourite-thing']}.
If the field name is named with camel case the solution is: ${data.favouriteThing}

I’ve added your recommendation of using camel case for field names to the docs: Comparing Cockpit-HQ:main...tsch0hnny:patch-1 · Cockpit-HQ/docs · GitHub

I’ve also updated the section “Set of fields” with the above: Comparing Cockpit-HQ:main...tsch0hnny:patch-2 · Cockpit-HQ/docs · GitHub

I’m new to contributing to docs, so please let me know if there’s a better location and/or wording.

1 Like