Search code examples
phplayoutblockmoodle

Why moodle block is not showing?


I have fallowing Moodle document for creating a new block, called "simplehtml" liked document, I can install this block, but why when I put this fallowing code in layout, it is not returning anything for rend?

Code in layout for call my block:

<?php echo $OUTPUT->blocks('simplehtml', 'span4 desktop-first-column'); ?>

Solution

  • That's not how blocks work. Block is like a widget. Add it to the page using the interface:

    https://docs.moodle.org/29/en/Block_settings#Adding_a_block_to_a_page