Aadvark custom theme - Moodle 1.9

Aadvark custom theme - Moodle 1.9

by Jonathan Burgos -
Number of replies: 15

Hi,

Recently, someone shows me an Aadvark theme customization for Moodle 1.9, it consists in hide the outline for the students and shows an html page. An administrator can show or hide the outline with the turn editing on/off button.

This is an example of what I'm trying to do

 

 

So far I can view the html page, but the problem is that i can't view the outline with the turn editing on/off button. Somebody knows what is missing?

Thank you.

Average of ratings: -
In reply to Jonathan Burgos

Re: Aadvark custom theme - Moodle 1.9

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

Hi Jonathan,

Is the OUTLINE that you are wanting to show/hide part of a course page?
 If it is a course page, than it is more than likely a customised Course Format plugin you have seen demonstrated in that other theme you mentioned.

The best person to ask about this type of course format is Gareth Barnard who has built different course formats for Moodle 1.9 as well as Moodle 2.0.

Mary

In reply to Mary Evans

Re: Aadvark custom theme - Moodle 1.9

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

Dear Jonathan,

So can I clarify, that what you want is to show a web page at the top to all and an administrator to be able to decide if a student can see the 'outline'?  By 'outline' do you mean section 0 or the entire course?

What is your target version of Moodle?  Are you using a customised theme?

Cheers,

Gareth

In reply to Jonathan Burgos

Re: Aadvark custom theme - Moodle 1.9

by Jonathan Burgos -

Hi Mary and Gareth,

The outline is the "tree" of topics and activities, the student can't view this "tree". When the student access to his course, he only can see the html page.

As an administrator, I need to see this "tree" so I can make changes in the activities.

 

 

So far I can only view the html page but the turn editing on/off button doesn't show me the topic outline. I modified the header.html file from the aardvark_liteheaded theme with this line:

 

 <?php
    if($ruta==$CFG->wwwroot.'/course/view.php'){     
        ?>
        <div class="inicio_curso">
          <iframe width="960" height="550" src="http://www.domain.com.mx/files/index.html" frameborder="0" style="margin-top: 0px"></iframe>

 

If I use this theme in the Moodle 1.9.15 where I see this customisation, the theme works perfectly, if I use this theme in a different Moodle (same version) the turn editing on/off button doesn't works, so I think that maybe is a configuration issue.

Thank you so much Mary and Gareth.

BTW, Sorry for my grammar mistakes, my english is not as good as should be. ;)

In reply to Jonathan Burgos

Re: Aadvark custom theme - Moodle 1.9

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

Dear Jonathan,

I see, thank you.  The complicated solution would be to have a custom course format based upon topics which found the first web page resource in section 0 and displayed that as the web page.  It would then be able to hide most of the rest (bar blocks which you might need) for a student and yet show for an editing user.

But if you want to experiment further, then the code:

$coursecontext = get_context_instance(CONTEXT_COURSE, $course->id);

if (isediting($course->id) && has_capability('moodle/course:update', $coursecontext)) { ......

Tells you if a person is editing the page, as long as somewhere you have a $course object in scope - course formats already do.  I believe it is created in '/course/view.php'.

This - 

- is the link to my YouTube video on creating a custom course format I did for iMoot 2012 it shows Moodle 2.2 but the principles are the same for Moodle 1.9.

Cheers,

Gareth

In reply to Gareth J Barnard

Re: Aadvark custom theme - Moodle 1.9

by Jonathan Burgos -

Thank you so much Gareth,

I'm gonna try to experiment with your suggestions.

Cheers.

In reply to Gareth J Barnard

Re: Aadvark custom theme - Moodle 1.9

by Irma Gamez -

Hi Garet.

I watched your video and I found very usefull, mostly because you modified the section 0. We create the courses automatically (about 900) and all of them have two web pages and a resource in common. So I need to add that resources at level code. I really don´t know how to do that. Can you give me some advise?

Than you.

In reply to Irma Gamez

Re: Aadvark custom theme - Moodle 1.9

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

Hi Irma,

What kind of Resource is this that you are talking about? Is it somekind of interactive LMS that needs embedding into Section 0 of the course page? Doing this automatically does make sense.  So if you could expand on the TYPE of resource then we may be able to help.

In reply to Mary Evans

Re: Aadvark custom theme - Moodle 1.9

by Irma Gamez -

Hi.

Thanks for reply. I need two web pages, a link to a document, besides the news forum that appears by default. That resources are common for all the courses.

In reply to Irma Gamez

Re: Aadvark custom theme - Moodle 1.9

by Richard Oelmann -
Picture of Core developers Picture of Plugin developers Picture of Testers

Just a query/suggestion - Might it be easier, rather than modifying Section0 automatically and digging into core code, might it be possible to add these resources as part of the theme, above Section 0 and below the header? 

Richard

In reply to Richard Oelmann

Re: Aadvark custom theme - Moodle 1.9

by Irma Gamez -

Yes! Actually I made a custom theme but the big problem for me is how to add the resources to the array $mods. sad 

In reply to Irma Gamez

Re: Aadvark custom theme - Moodle 1.9

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

Where is array $mods?

By the way, because you have already got another discussion going on I have now MOVED that discussion to Course Formats because it was NOT really theme related.

I will leave this one here if you want to pursue creating a course theme that has this functionality.

The only problem I can see is that we don't really support Moodle 1.9 now as this along with Moodle 2.0 & Moodle 2.1 have been  depreciated although people are using them.

Moodle 2.4 will be released towards the end of this year and course formats are changing rapidly.


  

In reply to Mary Evans

Re: Aadvark custom theme - Moodle 1.9

by Irma Gamez -

$mods is in the file \course\format\topics\format.php at line 130: 

        print_section($course, $thissection, $mods, $modnamesused);

If I write something after that line:

print_section($course, $thissection, $mods, $modnamesused);
echo 'algo para linkear <a href="http://www.google.com">Google</a>';

it appears at section 0. I just don´t how to call an activity resource instance.

Attachment dibujo.png
In reply to Irma Gamez

Re: Aadvark custom theme - Moodle 1.9

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

The easiest way is to create the resource in a seperate course. Then once you have the URL for that resource you can use it. For example:

1. <a href="<?php echo $CFG->wwwroot  ?>/mod/page/view.php?id=15" >Resource</a>

However it would be far easier to have a "course theme" where all the resources can be added to the header.html in a seperate section just below the header, almost like a menu.

This 'course theme' could then be set to be 'forced' used for the course page.

Would that work do you think?

Mary