Nicolas Posted 12 hours ago Share Posted 12 hours ago Is there a way to display/allow HTML tags in custom repeater label ? // CHange the label of the grape variety repeater $this->addHookAfter('InputfieldRepeater::renderRepeaterLabel', function(HookEvent $event) { $repeater = $event->object; if($repeater->name === 'grape_varieties') { $option_page = $event->arguments(2); $event->return = $option_page->title . '<span>(' . $option_page->color . ')</span>'; } }); Using the code above the span tag is escaped and not interpreted in the label. Link to comment Share on other sites More sharing options...
Robin S Posted 3 hours ago Share Posted 3 hours ago To do this I think you'll have to hook the rendering of the repeater item, which is a fieldset: $wire->addHookBefore('InputfieldFieldset(name^=repeater_item)::render', function(HookEvent $event) { $inputfield = $event->object; $inputfield->label = $event->wire()->sanitizer->unentities($inputfield->label); }); Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now