User tests: Successful: Unsuccessful:
In Bootstrap, you have input addons and currently in Joomla, if you want to achieve this, you need to create an custom form field.
Other than that, I see a low of extension devs definiing these sort of things in the language string.
Add the following code to an XML file for an extension:
You can use addonBefore
or addonAfter
or both. Take your pick.
<field
name="foo"
type="text"
label="Font Size"
default="13"
addonBefore="foo"
addonAfter="px"
/>
addonBefore
and addonAfter
attributes will need adding to: https://docs.joomla.org/Text_form_field_type
Status | New | ⇒ | Pending |
Category | ⇒ | Layout Libraries Front End Plugins |
Labels |
Added:
?
|
Category | Layout Libraries Front End Plugins | ⇒ | Layout Libraries |
The markup might be Bootstrap specific but at least the concept isn't (Foundation supports input groups out of the box, I want to say I've seen something like it with Semantic UI or Materialize too).
Added support for before and after the input. Testing instructions also updated.
XML can be overridden, find a plugin hook before your chosen form is loaded and add a lookup path for your override path, problem solved. Option B is existing plugin events where you can manipulate the JForm
instance.
(No, we shouldn't be making form declarations as easy to override as layouts because those serve a completely different purpose and we'd be getting a lot of "I overrode X form and all my crap broke" reports if we did it)
I have tested this item
Nice!
I have tested this item
Status | Pending | ⇒ | Ready to Commit |
Status | Ready to Commit | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2017-05-13 19:21:58 |
Closed_By | ⇒ | wilsonge | |
Labels |
Added:
?
|
I like the idea. The only downside I see is that the layout is more coubled to BS4 now. Previously it was framwork agnostic.
But since the layout is overrideable anyway it isn't an issue in my eyes (other views may differ).