Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Moodle Editing Templates

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

like image 707
Alan PS Avatar asked Mar 24 '16 19:03

Alan PS


People also ask

How do I use a Moodle template?

Templates in Moodle are used for rendering the output such as HTML or email messages bodies. Templates are defined as a text with placeholder tags. Placeholder tags are replaced with actual values during the rendering. Templates can be rendered both on the server side in PHP as well as on the client side in JavaScript.

How do I create a course template in Moodle?

Using a backup course as a template It is possible during the process of creating courses with a csv file in Site administration>Administration>Courses>Upload courses to specify and upload a backup file to be used as a template. Create your csv file.

What are themes in Moodle?

A Moodle theme allows the user to change the look and feel of a Moodle site. Themes can be applied on the site, category, course and activity levels by users with permissions to do so. Themes can be designed for specific devices such as mobile phones or tablets.


1 Answers

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:

  • https://docs.moodle.org/dev/Output_renderers
  • https://docs.moodle.org/dev/Renderer
  • https://docs.moodle.org/dev/Output_API
  • https://www.google.com
like image 65
Joe Avatar answered Oct 04 '22 07:10

Joe