I m working on a new Moodle Assignment plugin. How can I include a custom CSS to my plugin? I m using Moodle 1.9.7.
Thanks in advance.
I m working on a new Moodle Assignment plugin. How can I include a custom CSS to my plugin? I m using Moodle 1.9.7.
Thanks in advance.
just add a file called styles.php into the Module s folder. the file should output CSS code when it is parsed.
Moodle goes into each Module s folder and looks for that file, when the page s CSS layout is constructed.
Some themes can ignore these files using a special setting in the theme s config.php file
$THEME->modsheets = true;
/// When this is enabled, then this theme will search for
/// files named "styles.php" inside all Activity modules and
/// include them. This allows modules to provide some basic
/// layouts so they work out of the box.
/// It is HIGHLY recommended to leave this enabled.
here is a short sample of what could be the content of this styles.php file:
/* simple CSS code */
.left { float:left; }
/* php that generate CSS code */
< ?php if ( right_to_left() ) {echo ".right:text-align:left;"}
else {echo ".right:text-align:right;"} ?>
Perhaps could take a look at the function print_header_simple()
defined in lib/weblib.php
.
If you are writing a module which generates module specific pages, and they use the normal moodle libraries then stick something in $meta
to be added to the <head>
section while the page is being generated.
in lib/weblib.php
:
function print_header_simple($title= , $heading= , $navigation= , $focus= , $meta= , $cache=true, $button= , $menu= , $usexml=false, $bodytags= , $return=false) {
This means that you probably want something like the following in your module:
$extra_css = $CFG->wwwroot. /theme/SUPA4/supa_report.css ;
$extra_css_meta = <link rel="stylesheet" type="text/css" href=" .$extra_css. " /> ;
print_header_simple($mytitle, "", $navigation, "", "", true, "", navmenu($course), , $extra_css_meta);
I am trying to create a search text-field like on the Apple website. The HTML looks like this: <div class="frm-search"> <div> <input class="btn" type="image" src="http://www....
I have a button that opens a dialog when clicked. The dialog displays a div that was hidden After I close the dialog by clicking the X icon, the dialog can t be opened again.
selectBox.selectCSS { background: url(/Images/replacementSelectBackground.png) top left no-repeat height:auto; } I have an issue in Safari only where the image is not rendering on top ...
How do you target specifically safari in css with styles?
Ive used the following css code to align my form elements: form { position:relative; } form input { position:absolute; left:11em; } However, the textarea element is not aligned correctly with the ...
So I ve got a menu with a hover/selected state and it loads fine in IE6/IE7. However when I scroll down the page and put the element outside of the viewport and then back in I get a broken image! I ...
I am building some basic HTML code for a CMS. One of the page-related options in the CMS is "background image" and "stretch page width / height to background image width / height." so that with large ...
I have defined my page footer in the css file as: #footer { position: absolute; height: 50px; text-align: center; background: #66CCCC; bottom: 0px; left: 0px; width: 100%; height: ...