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

 

 

რეიტინგების საშუალო: -
In reply to stefan hoefler

Re: Unable to override format_topcoll_renderer in theme

by Gareth J Barnard -
Core developers სურათი Particularly helpful Moodlers სურათი 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 -
Core developers სურათი Particularly helpful Moodlers სურათი 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 Marina Glancy -
Core developers სურათი Moodle HQ სურათი Moodle Workplace team სურათი Peer reviewers სურათი Plugin developers სურათი 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

რეიტინგების საშუალო: Useful (1)