Note:

If you want to create a new page for developers, you should create it on the Moodle Developer Resource site.

Add a block cleanup: Difference between revisions

From MoodleDocs
(project infobox, disabling blocks if the feature is disabled, disabling less useful blocks)
 
m (Protected "Add a block cleanup": Developer Docs Migration ([Edit=Allow only administrators] (indefinite)))
 
(8 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{Template:Migrated|newDocId=/general/projects/code/block-cleanup}}
{{Infobox Project
{{Infobox Project
|name = Add a block cleanup
|name = Add a block cleanup
|state = In progress
|state = Completed
|tracker = MDL-73299 (epic)
|tracker = MDL-73299 (epic)
|discussion =  
|discussion = [https://moodle.org/mod/forum/discuss.php?d=429959 Add a block cleanup for Moodle 4.0]
|assignee = Sara Arjona
|assignee = Sara Arjona
}}
}}
Line 9: Line 10:


In the Add a block menu, the list of blocks is really long. This project is about figuring out how to reduce the list.
In the Add a block menu, the list of blocks is really long. This project is about figuring out how to reduce the list.
==Disabling blocks if the feature is disabled==
==Disabling blocks if the feature is disabled==
 
Blocks such as the blog menu, blog tags and recent blog entries will be disabled if blogs are disabled in advanced features.
Blocks such as the blog menu, blog tags and recent blog entries should be disabled if blogs are disabled in advanced features.


Blocks this applies to:
Blocks this applies to:
* Accessibility review
* Accessibility review
* Blog menu
* Blog menu
Line 22: Line 20:
* Comments
* Comments
* Course completion status
* Course completion status
* Flickr
* Global search
* Global search
* Latest badges
* Latest badges
* Learning plans
* Learning plans
* Network servers
* Random glossary entry
* Random glossary entry
* Tags
* Tags
* Network servers
==Disabling less useful blocks==
Some blocks that we have disabled by default are:
* Course summary
* Feedback - as the block only works if a Feedback activity is added to the site home page
* Remote RSS feeds - as RSS feeds are not used as much these days
* Self completion - as the block is only needed if self completion is enabled in the course completion settings (as mentioned in the setting).
 


==Disabling less useful blocks==
For new installs, the above blocks will disabled by default.


The Administration and Navigation blocks are only needed if the Classic theme is used. We can mention in the interface when enabling the Classic theme that the Administration and Navigation blocks need to be enabled and provide a link to the Manage blocks page.
For upgraded sites, we check if there are any instances of the block and if not, disable it.


Other blocks that we can consider disabling include:
==Letting themes define "unneeded" blocks==
The Administration and Navigation blocks are only needed if the Classic theme is used.


A new theme setting has been added to let themes mark blocks as "unneeded" (to avoid them being displayed in the "Add a block" list). This will allow Boost to mark the following blocks as unneeded:
* Navigation
* Administration
* Courses - as we have My courses in 4.0
* Courses - as we have My courses in 4.0
* Section links - as the course index in 4.0 provides access to sections
* Section links - as the course index in 4.0 provides access to sections
* Course summary
* Feedback - as the block only works if a Feedback activity is added to the site home page
* Remote RSS feeds - as RSS feeds are not used as much these days
* Self completion - as the block is only needed if self completion is enabled in the course completion settings. Instead we can mention in the interface that for self completion, the block needs to be enabled by an administrator.


For new installs, the above blocks can be disabled by default.


For upgraded sites, we should check if there are any instances of the block and if not, disable it.
As it's a theme setting, admins can still remove them from this "unneeded" blocks list, if, for any reason, they want the block to be available in the "Add a block" list.

Latest revision as of 12:08, 28 June 2022

Important:

This content of this page has been updated and migrated to the new Moodle Developer Resources. The information contained on the page should no longer be seen up-to-date.

Why not view this page on the new site and help us to migrate more content to the new site!

Add a block cleanup
Project state Completed
Tracker issue MDL-73299 (epic)
Discussion Add a block cleanup for Moodle 4.0
Assignee Sara Arjona

Moodle 4.0


In the Add a block menu, the list of blocks is really long. This project is about figuring out how to reduce the list.

Disabling blocks if the feature is disabled

Blocks such as the blog menu, blog tags and recent blog entries will be disabled if blogs are disabled in advanced features.

Blocks this applies to:

  • Accessibility review
  • Blog menu
  • Blog tags
  • Recent blog entries
  • Comments
  • Course completion status
  • Global search
  • Latest badges
  • Learning plans
  • Network servers
  • Random glossary entry
  • Tags

Disabling less useful blocks

Some blocks that we have disabled by default are:

  • Course summary
  • Feedback - as the block only works if a Feedback activity is added to the site home page
  • Remote RSS feeds - as RSS feeds are not used as much these days
  • Self completion - as the block is only needed if self completion is enabled in the course completion settings (as mentioned in the setting).


For new installs, the above blocks will disabled by default.

For upgraded sites, we check if there are any instances of the block and if not, disable it.

Letting themes define "unneeded" blocks

The Administration and Navigation blocks are only needed if the Classic theme is used.

A new theme setting has been added to let themes mark blocks as "unneeded" (to avoid them being displayed in the "Add a block" list). This will allow Boost to mark the following blocks as unneeded:

  • Navigation
  • Administration
  • Courses - as we have My courses in 4.0
  • Section links - as the course index in 4.0 provides access to sections


As it's a theme setting, admins can still remove them from this "unneeded" blocks list, if, for any reason, they want the block to be available in the "Add a block" list.