Admin CSS in modules
Posted: Thu Apr 02, 2009 6:23 pm
While writing a module that includes a number of admin forms, I wanted to dictate the size of some textarea's to reduce space. Following the docs:
I first tried specifying the $width and $cols, to no avail. The size of textareas is overridden by the theme's style.css.
Although you can specify a $classname, there seem to be no way to declare the class in admin css, short of creating a whole theme...
Eventually I found from the source that the function supports an undocumented $addtext parameter:
so I could call it using the rather untidy:
It would be neater if a module could provide its own CSS (e.g. /modules/modulename/css/modulename.css) which were included in the module's admin pages after the theme CSS, allowing it to override or supplement it.
Is there a better way of solving the problem?
Brian
Code: Select all
void CreateTextArea (bool $enablewysiwyg, string $id, string $text,
string $name, [string $classname = ''], [string $htmlid = ''], [string $encoding = ''],
[string $stylesheet = ''], [string $width = '80'], [string $cols = '15'], [string $forcewysiwyg = ""])
Although you can specify a $classname, there seem to be no way to declare the class in admin css, short of creating a whole theme...
Eventually I found from the source that the function supports an undocumented $addtext parameter:
Code: Select all
function CreateTextArea($enablewysiwyg, $id, $text,
$name, $classname='', $htmlid='', $encoding='', $stylesheet='', $cols='80',
$rows='15',$forcewysiwyg='',$wantedsyntax='',$addtext='')
Code: Select all
$this->CreateTextArea(false, $id, $address, 'address','','','','','','','','',
'style="width: 18em; height: 6em;"')
Is there a better way of solving the problem?
Brian