Page not showing up in Aardvark theme

Page not showing up in Aardvark theme

by Scott Karren -
Number of replies: 23

All,

I am testing Moodle version 2.4.4+ build 20130614 with the 2.4 version of Aardvark.  I came across an issue where certain pages are not rendering in aardvark but the are in all of the standard themes. See the screenshots below.

Afterburner Theme

 

Aardvark theme

At first I thought it might be related to some CSS issue but since verifying that it is working correctly in the standard themes I am more inclined to think that it is something related to the general.php layout file within Aardvark.  In looking at that file I noticed that it does not appear to be written using PHP the way the other default.php layout files are written. As such I am not sure how to troubleshoot this further.  Any ideas would be helpful.

Scott

 

Average of ratings: -
In reply to Scott Karren

Re: Page not showing up in Aardvark theme

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

Which version of AardvarK?  I would like to test this.

Cheers

Mary

In reply to Mary Evans

Re: Page not showing up in Aardvark theme

by Scott Karren -

Mary

I am using the 2.4 version from Shauns GIT site.  The page in the screenshots is using Remote Learners ELIS integrations on my server.  If you have ideas I am happy to test them out as well.

Scott

In reply to Mary Evans

Re: Page not showing up in Aardvark theme

by Scott Karren -

Mary

I just downloaded and installed the Aardvark Post-it theme that you created and it appears to work (at least on the pages shown above).  The major difference that I see in the general.php in Aardvark and the default.php in Aardvark Post-it is that Aardvark uses "echo core_renderer::MAIN_CONTENT_TOKEN;"  While Aardvark Post-it uses  "echo $OUTPUT->main_content()".

I haven't had time to test fully but is it possible that this may be causing the pages to not show up?

Scott

In reply to Scott Karren

Re: Page not showing up in Aardvark theme

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

More than likely as echo core_renderer::MAIN_CONTENT_TOKEN was depreciated in 2.1 (I think).

In reply to Mary Evans

Re: Page not showing up in Aardvark theme

by Scott Karren -

Well, I replaced this line in the general.php file and it had no effect.  I think I am going to wait and see if Shaun's new version is compatible with 2.4.4+ before I do anymore hacking on my own.

Scott

In reply to Scott Karren

Re: Page not showing up in Aardvark theme

by Shaun Daubney -

Sorry the new version is 2.5+ only due to the bootstrap engine requirement. I'd recommend the upgrade though if you're able to.

In reply to Shaun Daubney

Re: Page not showing up in Aardvark theme

by Scott Karren -

Shaun

It was worth asking about.  I will continue hacking away to see if I can figure out what is going on.  I decided to re-write the general.php to see if that would fix problems.  I am not all that versed in writing PHP and Div tags, would you mind taking a gander at it and see if I messed up anything substantial? Thanks in advance.

Scott

 

In reply to Scott Karren

Re: Page not showing up in Aardvark theme

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

At a glance it looks to be OK. If you enable debugging in Site Administration > Development > Debugging (set it to DEVELOPER mode) so that if it is wrong you will get some PHP warnings which you can paste here and we can try and help you fix them.

As for the pages you are not seeing, can you check aardvark/config.php to see if the parent themes are listed in the correct order? The should look like this...

$THEME->parents = array(
    'canvas',
    'base',
);

or like this...

$THEME->parents = array( 'canvas', 'base');

either way 'canvas' needs to be FIRST and NOT last which may well be the case in your version. If it is that Canvas is last then you need to correct it by using the above code.

In reply to Mary Evans

Re: Page not showing up in Aardvark theme

by Shaun Daubney -

Try what mary said. She's right that canvas and base are the wrong way round in config.php

In reply to Shaun Daubney

Re: Page not showing up in Aardvark theme

by Scott Karren -

Mary and Shaun

Thanks, I will give this a look / see.  Shaun, could you attach your file to a post or pm it to me, google docs is blocked at my work.

Scott

In reply to Scott Karren

Re: Page not showing up in Aardvark theme

by Scott Karren -

I switched the base and canvas references in the config.php and that resolved a couple of niggling issues that I was ignoring, but did not allow me to view the pages that I need to.  I noticed that those pages are using the standard layout that points to the general.php file, is it possible that because this file is not written in php that these pages are just not recognizing that they should be viewable?  I hope that makes sense.

Scott

In reply to Scott Karren

Re: Page not showing up in Aardvark theme

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

What do you mean that that page is not written in PHP?

In reply to Mary Evans

Re: Page not showing up in Aardvark theme

by Scott Karren -

Here is an excerpt from the general.php file that I am currently using:

// Page content

echo html_writer::start_tag('div', array('id'=>'page-content'));
echo html_writer::start_tag('div', array('id'=>'region-main-box'));
echo html_writer::start_tag('div', array('id'=>'region-post-box'));
echo html_writer::start_tag('div', array('id'=>'region-main-wrap'));
echo html_writer::start_tag('div', array('id'=>'region-main'));
echo html_writer::start_tag('div', array('class'=>'region-content'));
echo html_writer::start_tag('div', array('id'=>'mainpadder'));
echo $OUTPUT->main_content();
//echo core_renderer::MAIN_CONTENT_TOKEN;
echo html_writer::end_tag('div');
echo html_writer::end_tag('div');
echo html_writer::end_tag('div');
echo html_writer::end_tag('div');

if ($hassidepre) {
echo html_writer::start_tag('div', array('id'=>'region-pre', 'class'=>'block-region'));
echo html_writer::start_tag('div', array('class'=>'region-content'));
echo $OUTPUT->blocks_for_region('side-pre');
echo html_writer::end_tag('div');
echo html_writer::end_tag('div');
}

if ($hassidepost) {
echo html_writer::start_tag('div', array('id'=>'region-post', 'class'=>'block-region'));
echo html_writer::start_tag('div', array('class'=>'region-content'));
echo $OUTPUT->blocks_for_region('side-post');
echo html_writer::end_tag('div');
echo html_writer::end_tag('div');
}

echo html_writer::end_tag('div');
echo html_writer::end_tag('div');
echo html_writer::end_tag('div');

// End of content

 

There is a starting php tag and an ending php tag.  So I am wondering if this might be causing issues?

Scott

In reply to Scott Karren

Re: Page not showing up in Aardvark theme

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

The fact this line is commented out is wrong for starters...

//echo core_renderer::MAIN_CONTENT_TOKEN;

You need to remove the above code and replace it with this instead...

echo $OUTPUT->main-content();

In reply to Mary Evans

Re: Page not showing up in Aardvark theme

by Scott Karren -

That line is actually right above the commented out line.  I have noticed that every theme these pages work in including the existing third party theme I am using is written like the following:

<!--Start Moodle Content test-->

<div id="page-title">
<div id="page-title-inner">
<?php echo $PAGE->title; ?>
</div>


<?php if (($isfrontpage) && ($hastitledate)) { ?>
<div id="page-title-date">
<?php echo date("l d F Y"); } else {} ?>
</div>
</div>

<div id="jcontrols_button">
<div id="jcontrolsleft">
<?php if ($hasnavbar) { ?>
<div id="navbar clearfix">
<div id="breadcrumb"> <?php echo $OUTPUT->navbar(); ?></div>
</div>
<?php } ?>
</div>

<div id="ebutton">
<?php if ($hasnavbar) { echo $PAGE->button; } ?>
</div>
</div>

<div id="page-content">
<div id="region-main-box">
<div id="region-post-box">
<div id="region-main-wrap">
<div id="region-main">
<div class="region-content">
<div id="mainpadder">
<?php echo $OUTPUT->main_content() ?>
</div>
</div>
</div>
</div>

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

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

So, I am beginning to wonder if the way the file is written is the cause of the problem.

Scott

In reply to Scott Karren

Re: Page not showing up in Aardvark theme

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

It shouldn't make any difference as it is written as most renderer code is written in Moodle core that uses HTML writer. It gets deciphered back into HTML and has all the elements it needs to work as it should.

I need to see this theme again and see exactly what's happening.

In reply to Scott Karren

Re: Page not showing up in Aardvark theme

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

Hi,

I've just spent a good few hours checking the php/CSS for this theme and found some errors in the general.php.

That said it has a lot of stuff that is more 2.5 than 2.4 so that could be a problem in itself.

I need to know which pages you were having problems with Scott, so can you please tell me how to get to those problem pages, then I can do some proper testing?

Thanks

Mary

In reply to Mary Evans

Re: Page not showing up in Aardvark theme

by Scott Karren -

Mary

Thanks for looking at this.  Getting to those pages is going to be a trick because they are part of the community edition of the ELIS integration by Remote Learner and I am guessing that you don't have that setup. Let me know what I can do on this end, I am happy to/need to test this.

FYI, If I have debugging turned on and set to developer I don't get any errors.

Can you tell me what errors you found in the general.php and css for aardvark and I can make changes accordingly on my side to see what effect they have.

Scott

In reply to Scott Karren

Re: Page not showing up in Aardvark theme

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

If I zip up the theme and upload it to my website you can d/load it from there.

I'll add a note of the fixes I have added so you can compare them.

Let me know how you get on testing it.

I'll message you with a link shortly.

cheers

Mary

In reply to Mary Evans

Re: Page not showing up in Aardvark theme

by Scott Karren -

Ok,  With Mary's help I have figured out why those pages were not showing up.  I know have another mystery that I don't know if I want to solve.  One of the components of my site was an image slider on the front page using the instructions offered at http://gshaw0.wordpress.com/2012/05/15/how-to-add-an-image-rotator-in-moodle-2-2/ .  After Mary sent me the changes she made to the Aardvark theme I decided to drop them in without any of the customizations that I had made to see what would happen, low and behold the pages worked.  I added in my customizations and the pages stopped working.  I went back and examined every file and realized that the biggest difference between configs was the addition of this line: $THEME->javascripts_footer = array('jquery','easyslider','enableslider');  I commented it out and it started working again.  Apparently the ELIS integration implements some js in constructing those pages and my slider was interfering.

 Now I have to decide how important the slider is vs. pages not working.  Anyone have any thoughts on what I can do with this?

Mary, thanks a bunch for your update, it has cleared up some other niggling issues that I had and works loads better.

Scott

In reply to Scott Karren

Re: Page not showing up in Aardvark theme

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

In Moodle 2.5 jQuery wont work unless you add it in a special way as it is not the preferred way of doing JavaScript in Moodle. That said, however, jQuery has a setting that helps you out of the conflict...READ MORE...

In reply to Mary Evans

Re: Page not showing up in Aardvark theme

by Scott Karren -

Mary

Thanks for finding this information.  I understand in concept what it is doing but I have no idea how to implement it. This is far beyond my feeble skills.  How would I do this?

Scott

In reply to Scott Karren

Re: Page not showing up in Aardvark theme

by Shaun Daubney -

I'm not entirely sure. Try this aardvark_old.zip

It's the version I was using here until about 10am this morning. It's 2.4 compatible.