sebastian-lenz / craft-linkfield

Link field for Craft 3
MIT License
122 stars 65 forks source link

add specific display name for Solspace Event elements #234

Closed andrewmenich closed 2 years ago

andrewmenich commented 2 years ago

It seems that the 'Solspace\Calendar\Elements\Event' element is not setting its own display name, so in the Link Field it displays as "Element" which could be confusing to the client/authors.

geenious commented 2 years ago

This is great! Maybe even more specific, 'Calendar Event' to be even more clear.

sebastian-lenz commented 2 years ago

Hey @andrewmenich, thanks for the pull request. Actually this is an issue of the Solspace plugin as it does not correctly send a correct display name for its events. We are calling Element::displayName() here and the element implementation should overwrite that method to return a sensible name.

If we patch this on our side we should do it in a generic fashion so that is not directly bound to a certain plugin or vendor. E.g. we could introduce a customDisplayName on element link types that overwrites the display name exposed by the element api.

andrewmenich commented 2 years ago

@sebastian-lenz This makes perfect sense. Thanks for taking a look! I'll close this for now.