Add a Custom Block

  • Moodle version(s): 3.x
  • Last updated: May 17, 2020
  • By: Amy Spielmaker

Blocks are items which may be added to the sidebar of any page in Moodle. In this example, we’ll add a block with a list of student resources.

This is what we’re going to make.

Part 1
Add the block

  1. Find the “Add a Block” menu (usually at the bottom of the left sidebar on your Moodle course).
  2. Select HTML from the dropdown.

Part 2
Add the content

  1. For our example, we’ll leave the “HTML block title” empty.
  2. Add your content to the “Content” text area. Anything you add in this text area will display in your block in the sidebar. To make the Resource list in the example:
    • Click the code (</>) icon to access the html editor (you may have to click the toolbar toggle in the upper left to see the html editor icon).
    • In the textbox that opens, copy and paste the following “Text block content” HTML:

      See the Pen Resources Block by Amy Spielmaker (@akspiel) on CodePen.

Part 3
Set the display settings

  1. In the “Where this block appears” section, choose where you want the block to display. For the Resources block in the example, I chose Any page.
    • Both Any page and Any course page will make the block appear on every page, including the main course page, content pages, and assignments.
    • Any type of course main page will make the block appear only on your main Moodle page.
  2. In the “Region” field, choose Left or Right. I chose left to have the block be in the left sidebar.
  3. The “Weight” field determines the order of blocks.
    • A lower number means the block will be higher on the page (above other blocks).
    • A higher number means the block will be lower on the page (below other blocks).
  4. In the “On this page” section, you can change the block display settings on a per-page basis. I’m just going to leave it as is.
    My block display settings
  5. Click Save changes.