Cockpit-HQ / Cockpit

Cockpit Core - Content Platform
https://getcockpit.com
Other
388 stars 47 forks source link

Feature: Accessal of fields of a "Content link" within a "Set of fields" #78

Closed Sonorpearl closed 1 year ago

Sonorpearl commented 1 year ago

Feature: Accessal of fields of a "Content link" within a "Set of fields"

It would be very helpful if you display fields of a "Content link" within a "Set of fields" to display a meaningful entry in the item overview.

Currently, you can only access the "_id" Field, which results in something like this if the only meaningful entry otherwise would be a value: image

For example: The content "contentA" contains the field "Name". On content "contentB" you create a "Set of fields" and a field named "Link" which is a "Content link" to "contentA".

Right now you can only choose a "Display" on "contentB" like: ${data.Link._id}

But it would be perfect if you could display fields of "contentA", otherwise the Display becomes meaningless as shown above. Just like this for the field "Name": ${data.Link.Name} Right now this results in a display of "Undefined".

That is a functionality that we really miss from the old version.

Thanks in advance for the response.

aheinze commented 1 year ago

What will be possible in >v2.3.8:

Let's assume you've a set with a field named post which is linked to the posts model, then a possible display value can look like this:

${ $content(data.post, '${data.title}') }

This gets the linked posts item and displays its title