Unable to override format_topcoll_renderer in theme

Unable to override format_topcoll_renderer in theme

by stefan hoefler -
Number of replies: 7

Hey there,

how should i write my renderer to extends this format renderer or how should i start?

Cause the normal theme_themename_format_topcoll_renderer extends format_section_renderer_base didn't work and throw a whitescreen of death.

But normal course or calendar core renderers worked fine. Any suggestions or links or ideas?

moodle version: 2.5.2+ (Build: 20130920)

format_topcoll version: 2.5.3.1

thanks

 

 

Average of ratings: -
In reply to stefan hoefler

Re: Unable to override format_topcoll_renderer in theme

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

Hi Stephan,

Why do you want to do this?  And please see this post https://moodle.org/mod/forum/discuss.php?d=220810#p962848 which has a class diagram explaining the structure.

Gareth

In reply to Gareth J Barnard

Re: Unable to override format_topcoll_renderer in theme

by stefan hoefler -

Hi Gareth,

i want to override the section_header function and use a different heading tag instead of h3. So i thought the easiest way is to override the renderer wink

Thanks for the class diagram.

 

Stefan

In reply to stefan hoefler

Re: Unable to override format_topcoll_renderer in theme

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

Hi Stefan,

The 'h3' tag is there for accessibility reasons.  If you want to just change the look of the tag, then it's actually styled with a very specific CSS selector which can be specified in the theme and it will override.  For example, I just did the following using 'Clean's custom CSS box in M2.5:

.course-content ul.ctopics li.section .content .toggle a h3.sectionname {
color: #FF0000;
}

 And thanks for the information Marina smile

Cheers,

Gareth

In reply to Gareth J Barnard

Re: Unable to override format_topcoll_renderer in theme

by stefan hoefler -

Okay but i want to use h2 instead of h3...or some of our designer want that wink

thank you for your response.

In reply to stefan hoefler

Re: Unable to override format_topcoll_renderer in theme

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

Pragmatically from a UX point of view should it be 'h2' and not 'h3'?

In reply to stefan hoefler

Re: Unable to override format_topcoll_renderer in theme

by Marina Glancy -
Picture of Core developers Picture of Moodle HQ Picture of Moodle Workplace team Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

ah, here we go again. The similar discussion pops up every several months.

Extending format_section_renderer_base in the theme MAKES NO EFFECT. You must overwrite particular format's renderer, in this case format_topcoll_renderer

I need to finally remove this class. There is an issue for it: MDL-39119

Average of ratings: Useful (1)