Saturday, April 2, 2016

Moodle Editing Templates

Leave a Comment

How do I separate the blocks when editing a template?

Example:

<?php echo $ output->blocks('course_summary', 'cssCourse'); ?> 

I want to use the block with the course summary id, but he does not appear on the first page ...
................................................................

Or else thought but can not develop further on is this:

<?php echo $output->login_info(); ?> 

It prints the block login information, which gives to make loggof and edit profile, etc ... But I can about the other blocks, or disassemble the login info to separate for example Avatar User's his name ... etc...

Still waiting for help ...

1 Answers

Answers 1

Have a look here: https://docs.moodle.org/dev/Overriding_a_renderer

Basically you need to override output renderers to customize what $OUTPUT->blocks() renders. That method calls another method that will render blocks for a region (side-pre in this case). You should dig through the core_renderer class. Be careful when overriding blocks as to not break the editing state, which brings in extra controls to drag-and-drop and edit each block.

The block content itself is rendered in the block class. You can find it in moodle/blocks//block_.php. These you cannot override, but gives you an idea where the content comes from.

Related links that might be helpful:

If You Enjoyed This, Take 5 Seconds To Share It

0 comments:

Post a Comment