Create a own Joomla! module or plugin and add a css/mymodule.css.
Add the stylesheet into the mod_mymodule.php with:
JHTML::stylesheet(JURI::base() . '/modules/mod_mymodule/css/mymodule.css');
Hope that the css file is also loaded in backend to style my fields inserted via mod_mymodule.xml but is not loaded.
CSS file only loaded in frontend.
Joomla! 3.6.5
For public Modules, styling the Backend Template CSS is no option.
Only possible working fact is at the moment creating custom fields to insert CSS or own Styles.
The code's fine.
The modules/mod_mymodule/mod_mymodule.php
file doesn't get included in the backend editor. Including that file causes your module to be rendered, that's why you can't include it from the backend.
You should not need to add custom CSS to the backend manager unless you are adding custom fields needing additional styling not offered by the templates. Personal opinion, but I suggest making use of the admin template theming as much as possible (and with the module manager you're stuck doing just that unless you're adding custom fields) and only adding CSS when you just can't make it work. Not only is it less of a maintenance overhead for you, but it also keep your extension's management UI fitting in with the rest of the core backend UI so it just feels like a natural part of Joomla.
Ignore my previous comment. Misunderstood the issue.
Hello,
thanks, yes i see, only way are custom fields, but for example, a normal input text field have a other width as for examples the color picker or date picker field. so i thougt, making own width.
or when i have a large label for the field, the field runs out of alignment and is too much right and looks not good.
Think it would be better, if also the module.css is included inside backend view? My personal opinion.
This has nothing to do with com_fields. The custom fields reference is creating your own JFormField
subclass.
Priority | Medium | ⇒ | Low |
Status | New | ⇒ | Confirmed |
I am closing this as the expected behaviour
Status | Confirmed | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2017-05-21 15:03:02 |
Closed_By | ⇒ | brianteeman |
I think the issue is with your code and not Joomla. Try this:
JHTML::stylesheet(JURI::root(true) . 'modules/mod_mymodule/css/mymodule.css');
And it is advised to store media files in media folder.