Posted: January 25, 2023 at 2:25 am
I’m trying to add a few wrappers around certain elements on the registration.
Our theme sets a few widths on the form elements to make it more presentable. I’ve scoured the codebase for filters and hooks to make this easier without having to override templates.
I’ve managed to successfully wrap sections around question groups using
We use BEM to add modifiers to form elements to alter the width within a flexbox. It doesn’t seem that EE4 offers much in the way of customising questions this way.
We also use input placeholders as the label for our forms, but again, there doesn’t seem to be any options for this.
Have been able to partially solve this. For anyone else that comes across this issue.
Still no luck on adding classes to the
What you have above also works but note that
You should also be able to set the classes used for the input using the above filter, setting classes within the
My bad, I was meant to type
This is only for the input element though isn’t it?
What I’m after is the element that wraps the label and input elements, which usually ends up looking something like
Do you mean the
Sure but there’s a whole bunch of options for form inputs, it sounds like your need:
The example above is an ID (
html_class does seem to work, but not quite what I’m after
If I was to change
the input changes to
the wrapper div changes to
That does give me a little more control, but ideally I’d want to just control the wrapper div, and only prepend classes to what’s already there (without it appending
I appreciate that this is just how things work, and I’ll find a workaround for it. But it’d be nice to have singular control of only adding additional css classes and perhaps allowing these to be added on the question model itself so these kind of filters aren’t necessary.
Alas, you have led me to water again. I shall drink!