Toggle is a custom Moodle block that allows teachers to display collapsible sections, each with a title, optional subtitle, and structured list content. It’s perfect for presenting organized, nested information in a clean, user-friendly format.
- ✅ Custom block title and description
- ✅ Repeatable sections with:
- Title
- Optional subtitle
- Content area supporting nested ordered lists and sub-items using simple text syntax
- ✅ Responsive design
- ✅ Multiple block instances per course
- ✅ Only available to users with editing capabilities (e.g.
editingteacher
,manager
) - ✅ Uses Moodle’s built-in block configuration interface
- ✅ Clean and customizable HTML output with Mustache templates
- Moodle 4.x (tested on 4.3)
- User must have the capability
block/toggle:addinstance
- Clone or download this repository into your Moodle
blocks/
directory:
- cd /path/to/moodle/blocks
- git clone https://github.com/yourusername/moodle-block_toggle.git toggle
- Log in to Moodle as an admin
- Visit the Site Administration area to trigger the plugin installation
- Follow the on-screen instructions
Capability | Description | Allowed roles |
---|---|---|
block/toggle:addinstance |
Add the block to course pages | Editing teacher, Manager |
In the section content field, you can write plain text like this:
Main point one
- Subpoint A
- Subpoint B
Main point two
- Subpoint C
- Subpoint D
Which will render as:
- Main point one a. Subpoint A b. Subpoint B
- Main point two
All text strings are defined in lang/en/block_toggle.php
.
Developed by Marco Traina For support or contributions, open an issue or pull request on GitHub.
This plugin is licensed under the GNU GPL v3.