0
Hi, I’m creating a theme for Moodle and I can’t install it or do tests, the theme has only 3 files and the . css is blank, just for testing...
config.php file (is at the root of the theme that has the name temaTeste, so it is temaTeste/config.php)
<?php
$THEME->name = 'base';
$THEME->doctype = 'html5';
$THEME->parents = array();
$THEME->sheets = array('base');
$THEME->layouts = array(
// Most backwards compatible layout without the blocks - this is the layout used by default
'base' => array(
'file' => 'standard.php',
'regions' => array(),
),
);
$THEME->javascripts = array();
$THEME->javascripts_footer = array();
?>
standard.php file (temaTeste/layout/standard.php)
<?php
$hassidepre = $PAGE->blocks->region_has_content('side-pre', $OUTPUT);
$hassidepost = $PAGE->blocks->region_has_content('side-post', $OUTPUT);
echo $OUTPUT->doctype(); ?>
<html <?php echo $OUTPUT->htmlattributes() ?>>
<head>
<title><?php echo $PAGE->title ?></title>
<link rel="shortcut icon" href="<?php echo $OUTPUT->pix_url('favicon', 'theme')?>" />
<?php echo $OUTPUT->standard_head_html() ?>
</head>
<body id="<?php p($PAGE->bodyid); ?>" class="<?php p($PAGE->bodyclasses); ?>">
<?php echo $OUTPUT->standard_top_of_body_html() ?>
<table id="page">
<tr>
<td colspan="3">
<h1 class="headermain"><?php echo $PAGE->heading ?></h1>
<div class="headermenu"><?php echo $OUTPUT->login_info(); echo $PAGE->headingmenu; ?></div>
</td>
</tr>
<tr>
<td>
<?php echo $OUTPUT->blocks_for_region('side-pre') ?>
</td>
<td>
<?php echo core_renderer::MAIN_CONTENT_TOKEN ?>
</td>
<td>
<?php echo $OUTPUT->blocks_for_region('side-post') ?>
</td>
</tr>
<tr>
<td colspan="3">
<p class="helplink"><?php echo page_doc_link(get_string('moodledocslink')) ?></p>
<?php
echo $OUTPUT->login_info();
echo $OUTPUT->home_link();
echo $OUTPUT->standard_footer_html();
?>
</td>
</tr>
</table>
<?php echo $OUTPUT->standard_end_of_body_html() ?>
</body>
</html>
I need to install it in the Moodle and it needs to run, it is a simple theme just for study/test.
Does the documentation say anything about where these files should be? or how they are uploaded?
– rray
Dude, the documentation is very confusing and I couldn’t figure out how to use hardcoded Blocks, I need examples and I didn’t find there!
– Alan PS