An HTML block is a standard block used to add text or images in the sidebar of your course page.
An HTML block can incorporate a variety of functions and uses. It provides the standard Moodle Editor for formatting text, adding images or creating links, and switching to HTML view, which allows any valid HTML code to be used. Audio, images and other files can add unique elements to a course or site page.
To add an HTML block:
- On your course page, click Turn editing on (green pencil icon , top right). When editing is on, the Add a block block appears at the bottom of the right column.
- In the Add a block block, click Add... and select HTML from the drop-down menu. The HTML block will appear below the other blocks in the right column, named (new HTML block).
- At the right of the newly created HTML block, click the Edit icon () and select Configure (new HTML block) block. The Configuring a (new HTML block) block page will open.
- In the HTML block title box, enter a name for the block (optional).
- In the Content box, use Moodle Editor to add formatted text, images, links or other content, or to enter HTML code, click the HMTL icon () in the editing toolbar. The editor window will switch to a code view where can add any valid HTML code.
Note: We do not recommend embedding video in a block as it is unlikely to fit within the width of the block. Images, however, will always resize in Moodle to fit the available space.
- Click the HTML icon again to view a preview in the Content box.
- Click Save changes to return to your course page and view.