?
avatar Sh4d0wF1gh7
Sh4d0wF1gh7
16 Jan 2017

Steps to reproduce the issue

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');

Expected result

Hope that the css file is also loaded in backend to style my fields inserted via mod_mymodule.xml but is not loaded.

Actual result

CSS file only loaded in frontend.

System information (as much as possible)

Joomla! 3.6.5

Additional comments

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.

avatar Sh4d0wF1gh7 Sh4d0wF1gh7 - open - 16 Jan 2017
avatar joomla-cms-bot joomla-cms-bot - labeled - 16 Jan 2017
avatar SharkyKZ
SharkyKZ - comment - 17 Jan 2017

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.

avatar mbabker
mbabker - comment - 17 Jan 2017

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.

avatar SharkyKZ
SharkyKZ - comment - 17 Jan 2017

Ignore my previous comment. Misunderstood the issue.

avatar Sh4d0wF1gh7
Sh4d0wF1gh7 - comment - 21 Jan 2017

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.

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 5 Feb 2017

@laoneo as this Issue is about com_fields whats your Opinion?

avatar mbabker
mbabker - comment - 5 Feb 2017

This has nothing to do with com_fields. The custom fields reference is creating your own JFormField subclass.

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 5 Feb 2017

thanks @mbabker

avatar franz-wohlkoenig franz-wohlkoenig - change - 5 Apr 2017
Priority Medium Low
Status New Confirmed
avatar brianteeman
brianteeman - comment - 21 May 2017

I am closing this as the expected behaviour

avatar brianteeman brianteeman - change - 21 May 2017
Status Confirmed Closed
Closed_Date 0000-00-00 00:00:00 2017-05-21 15:03:02
Closed_By brianteeman
avatar brianteeman brianteeman - close - 21 May 2017

Add a Comment

Login with GitHub to post a comment