Skip to content

Event allowing overriding card HTML displayed in the control panel #15287

Answered by mmikkel
piotrpog asked this question in Ideas
Discussion options

You must be logged in to vote

There is a Cp::EVENT_DEFINE_ELEMENT_CARD_HTML event, which can be used to manipulate the HTML for element cards inside the control panel. I actually use this event in my CP Field Inspect plugin, in order to add a "Edit Entry Type" link to card action menus.

However, if the goal is to add some custom content to the card in addition to the custom fields exposed via the "Show in element cards" layout element option in field layout designers, that event is a bit cumbersome to use, since you have to parse the entire HTML for the rendered card and figure out how and where to inject your custom content.

To that end, it'd be great if another event (like EVENT_DEFINE_ELEMENT_CARD_BODY_FIELDS or si…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@brandonkelly
Comment options

Answer selected by piotrpog
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
None yet
3 participants