Moodle Editing Templates

How to separate blocks when editing a template?

Example:

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

I want to use the block with the ID of the final course, but it does not appear on the first page ...
.................................................. ..............

Or another thought, but cannot develop further:

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

It prints information for entering the block, which makes it possible to create a journal and edit a profile, etc. But I can about other blocks or disassemble the login information in order to separate, for example, Avatar User, his name ... etc ..

Still waiting for help ...

+6
source share
1 answer

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

Basically, you need to override the output means to customize what the $ OUTPUT-> blocks () rendering does. This method calls another method that will display blocks for the region (in this case, the side). You must dig the core_renderer class. Be careful when overlapping blocks so as not to disturb the editing state, which leads to additional controls for dragging and editing each block.

The block content itself is displayed in the block class. You can find it in moodle / blocks // block_.php. You cannot override this, but it gives you an idea of ​​where the content is coming from.

Links that may be helpful:

+1
source

All Articles