Themes

 
 
Picture of Adam Morris
Modding the course title via output renderer
 

Hi there,

The basic thing I'm trying to do here is change the course title that's displayed in the header, changing it to include the name of the current activity. How to do that in Moodle 2.5?

This is what I tried so far:

* From within the theme, I tried defining an init_page function that looks like it's supposed to be called from core_renderer. Can't get anything to work there at all.

* From within lib/outputrender.php printed out the page object with print_object but couldn't see any pattern or any obvious way of seeing what activity is available.

* Looking around the developer docs.

Thanks for any hints.

Adam

 
Average of ratings: -
It's only an avatar...
Re: Modding the course title via output renderer
Group DevelopersGroup Documentation writersGroup Particularly helpful MoodlersGroup Testers

Hi,

Knowing how Moodle works it will be something quite simple like...

$PAGE->activity->heading

But I will need to investigate.

Be back later unless some geek beats me to it! LOL

Mary (novice coder)

 
Average of ratings: -
Gareth J Barnard
Re: Modding the course title via output renderer
Group DevelopersGroup Particularly helpful Moodlers

I'm not a geek, but with '/lib/outputrenderers.php' as a reference and containing the class that theme's inherit from in some shape or form.... The method 'page_heading()' prints out the heading and I notice from observation and looking at 'navbar()' that the fifth item (when populated) contains the current activity name.

Gareth

 
Average of ratings: -