"unknown block region side-post" error creating new theme

"unknown block region side-post" error creating new theme

by Daniele Cordella -
Number of replies: 21
Picture of Core developers Picture of Plugin developers
I have to start thanking the writer of the moodle doc page
http://docs.moodle.org/en/Development:Themes_2.0_creating_your_first_theme.
Thanks for the time you spent helping us.

The explanation is really fine but even this, something is still not 100% clear to me.

I noticed that by building the excitement/layout/standard.php step by step following the provided explanation, the user build a file that is different from the one provided "for reference" at the end of the paragraph.

Moreover, even by accepting the code given "for reference" what I get is the error described in the attachment.

May I ask how to get out from it?
Thanks in advance.
Attachment Immagine_1.png
Average of ratings: -
In reply to Daniele Cordella

Re: "unknown block region side-post" error creating new theme

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers
That's possibly caused by the fact that the name side-block has now been changed to block. This comment is also a timely reminder I need to change this on the Moodle Doc as I volunteered to do it!

Do you used CVS to update your Moodle 2.0? If not it then consider setting up CVS on your computer. You can read how to do this in this Moodle Doc...

http://docs.moodle.org/en/CVS_for_Administrators

There are quite a number of posts in this forum which discuss all the recent changes in Moodle 2.0...


Re: .sideblock now .block
http://moodle.org/mod/forum/discuss.php?d=149583

and here

http://moodle.org/mod/forum/discuss.php?d=149561


Mary
Average of ratings: Useful (2)
In reply to Mary Evans

Re: "unknown block region side-post" error creating new theme

by Daniele Cordella -
Picture of Core developers Picture of Plugin developers
thanks Mary
but my problem is with side-post not side-block.

and then, yes I do use CVS update for moodle 2. sorridente
In reply to Mary Evans

Re: "unknown block region side-post" error creating new theme

by Daniele Cordella -
Picture of Core developers Picture of Plugin developers
As far as I understand
what is missing in the docs page mentioned above
is
<?php if ($hassidepre) { ?>
 <div id="region-pre">
 <div class="region-content">
 <?php echo $OUTPUT->blocks_for_region('side-pre') ?>
 </div>
 </div>
<?php }

if ($hassidepost) { ?> <div id="region-post"> <div class="region-content"> <?php echo $OUTPUT->blocks_for_region('side-post') ?> </div> </div> <?php } ?>

where variables have to be defined as:
$hassidepre = $PAGE->blocks->region_has_content('side-pre', $OUTPUT);
$hassidepost = $PAGE->blocks->region_has_content('side-post', $OUTPUT);

Average of ratings: Useful (2)
In reply to Mary Evans

Re: "unknown block region side-post" error creating new theme

by Daniele Cordella -
Picture of Core developers Picture of Plugin developers
Mary I am ready to support you in editing and correcting docs pages, but please do not ask me to correct them because my English is really bad.
In reply to Daniele Cordella

Re: "unknown block region side-post" error creating new theme

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers
Daniele,

Be my guest. Anyone can correct Moodle Docs as far as I know, as I could always correct your English! smile

I'm trying to think of the Italian equivalent of what the French say for Go on! Go on!...A'lé!, A'lé!

smile

Mary


In reply to Daniele Cordella

Re: "unknown block region side-post" error creating new theme

by Roy Rodenhäuser -
Had same problem yesterday with the doc:

http://docs.moodle.org/en/Development:Themes_2.0_creating_your_first_theme.

I've seen some changes have been made to the docs today but still I can't get it to work.
In reply to Roy Rodenhäuser

Re: "unknown block region side-post" error creating new theme

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers
Which bit are you stuck on? Post some questions here and we might be able to point you in the right direction.

Mary
In reply to Mary Evans

Re: "unknown block region side-post" error creating new theme

by Roy Rodenhäuser -
The problem was as Daniele said, so I included the missing conditionals and the variables definitions and now it works! Just had to read more carefully the corrections mentioned by Daniele.

Thanks a lot for your help! grande sorriso

Roy
In reply to Roy Rodenhäuser

Re: "unknown block region side-post" error creating new theme

by Daniele Cordella -
Picture of Core developers Picture of Plugin developers
Yes, I do confirm. Today I committed some minor changes as each one can verify. My first BASIC moodle 2 theme is now working too.
What I still didn't add are the corrections to make the step by step process and the "for reference" process equal.

Does anyone know in which variable is now the path of the theme folder? Just to add a picture to the header.
In reply to Daniele Cordella

Re: "unknown block region side-post" error creating new theme

by Roy Rodenhäuser -
I don't know about a variable with the path to the theme folder stored in it, but you can add an image to the header using the stylesheets:

#page-header {background-image:url([[pix:theme|imagename]]);}

Roy
Average of ratings: Useful (1)
In reply to Roy Rodenhäuser

Re: "unknown block region side-post" error creating new theme

by Daniele Cordella -
Picture of Core developers Picture of Plugin developers
Thanks Roy.
I was looking for $CFG->themewww, yesterday. (but I was already in the bed and too lazy to get out, search the code and read the name of the variable).

Yesterday I tried $CFG->themewww.'/'.current_theme() but with no success.

Anyway, thanks, I believe your answer is exactly what I need to add a picture via css.
Is there a way to add a picture directly in the layout/<<template>>.php page?
In reply to Daniele Cordella

Re: "unknown block region side-post" error creating new theme

by Roy Rodenhäuser -
You can place the line in red wherever you need in your layout.

In the following example you would be placing it in the header of your page.

Your image is supposed to be in the pix folder. 
<div id="page-header"> <
img src="<?php echo $OUTPUT->pix_url('imagename', 'theme');?>" alt="" />

</div> Roy
Average of ratings: Useful (1)
In reply to Daniele Cordella

Re: "unknown block region side-post" error creating new theme

by Daniele Cordella -
Picture of Core developers Picture of Plugin developers
what is still missing from the documentation is the need of
<?php if ($hassidepre) { ?>

and

if ($hassidepost) { ?>

too.

In reply to Daniele Cordella

Re: "unknown block region side-post" error creating new theme

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers
Can you not get this from Basic page-layout?
In reply to Mary Evans

Re: "unknown block region side-post" error creating new theme

by Daniele Cordella -
Picture of Core developers Picture of Plugin developers
Ciao Mary
yes, of course, I can.
The aim of my message was to integrate my previous message in which I posted what is still not updated in the documentation.

Do you know where $CFG->themewww was tranferred to?
In reply to Daniele Cordella

Re: "unknown block region side-post" error creating new theme

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers
Not sure...but I found this in Moodle/theme/image.php

$CFG->dataroot/cache/theme/$themename/pix/$component

if it helps?

Mary
In reply to Daniele Cordella

Re: "unknown block region side-post" error creating new theme

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
As has already been said, $CFG->themewww does not exist any more. Use $OUTPUT->pix_url, and don't make assumptions about the form of URLs pointing to the theme.
In reply to Daniele Cordella

Re: "unknown block region side-post" error creating new theme

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers
Dear all,

Having experienced the same issue, found the solution and read this thread, I've updated the documentation - http://docs.moodle.org/en/Development:Themes_2.0_creating_your_first_theme - in terms of code.

Cheers,

Gareth
Average of ratings: Useful (1)