6

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 ...

Alan PS
  • 197
  • 2
  • 12

1 Answers1

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:

Joe
  • 509
  • 1
  • 8
  • 24
  • hi, I understand where it comes from the blocks but could not put them to work, u have any example to help me? thanks – Alan PS Mar 26 '16 at 16:59
  • You will need to elaborate on what you're trying to accomplish. – Joe Mar 27 '16 at 02:44