Note:

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

Navigation 2.0

From MoodleDocs

Moodle 2.0


State of play 20th Feb 2009

How to meet the goals outlined here in Moodle 2.0 is a large subject. At the moment, there are various discussions going on in different forums, and there are several documents or proposals here. This note hopes to summarise what you need to read if you want to bring yourself up-to-date with what is going on.

  • Start by reading this page. It is Martin's summary of what we are hoping to achieve.

Then we get to the various forum threads and proposals:

I hope I have not forgotten anything. Naturally, once our plans are clearer, they need to be reduced to a single, comprehensible proposal.

Goals

Improving navigation in a complex web application like Moodle touches on a lot of areas, but in particular we must aim to hit these goals:

Clarity

It should be clearer what settings affect only yourself, and what settings affect what others see.

It should be clear what is global navigation (whole site), and what is local navigation (within a course or module).

Consistency

All parts of the interface should be consistent. We need to have a set of guidelines and core frameworks to better restrict what developers are allowed to do, while also reworking the core code to implement things like blocks and tabs in consistent ways.

Usability

Users should be able to easily learn what is there for them.

Users should be able to move around "their world" within Moodle with a minimum of effort.

Performance

Processing blocks and building up a page with navigation must be very efficient.

Backward compatibility

If possible, plugins should not have to change.

Users should also not find the new interface too different (just better!)

Scope

What parts of Moodle might be affected by this work?


Navigation bar

Since Moodle 1.9, we construct the navigation bar from an array using the build_navigation function. However, that converts all the data to a string, which is then passed to the theme. Instead, we should keep the information about the navigation bar links as structured data, and let the theme choose how to render it.


Local navigation

In different places we have the global administration tree, the Course admin block, the Jump to menu, tabs like in the user profile, various activities, in the roles UI, and the 'Update this forum' button. These are all ways of getting around nearby, related pages. It would be good to make these concepts more consistent. (There is also $homelink in the footer. Currently the HTML for this is generated in print_header.)

This is an area we need to think about a lot more

Please discuss here: http://moodle.org/mod/forum/discuss.php?d=115620

Blocks/pagelib

Blocks themselves should not change. What is currently inconsistent is how blocks get associated with particular pages. At the moment this is done through the (pageid, pagetype) columns of block_instance, and the pagetype column of block_pinned. Does it work if we change this to (contextid, pagetype)?

The other thought is, can we make sticky blocks more flexible? What if we let them be configured in any context, not just globally? This would let people do things like add a block to every course in a particular category.

Perhaps let themes control where on the page blocks can appear.

Some more thought required here.

Please discuss here: http://moodle.org/mod/forum/discuss.php?d=95882

Course view

What do we need on top of the existing course formats?


Themability

Give themers as much flexibility as possible, without having to do major changes throughout Moodle.

Let them change the HTML output by the print_XXX functions in weblib.php.

Should we allow themes to have their own lang files and settings.php page in the admin tree?

Theme engines for Moodle?

Design

As I write this, we don't have a clear overview of the whole solution, but following some discussions, I have some ideas about how some components of the solution should work, and I want to write them down. Therefore, I present a possible (partial) design. (Real development never happens as they teach in Software Engineering classes anyway. ;-) )--Tim Hunt 23:28, 29 January 2009 (CST)


Relevant tracker issues

These come from a review of all the 'Theme' tracker issues.

  • MDL-3625 $menu in header does too many things
  • MDL-3626 header.html and footer.html $variable inconsistency
  • MDL-8369 Folder-like presentation of the courses at the main page
  • MDL-9306 Main course formats need to have tables removed but keep AJAX working - there seem to be some regressions from this work ;-)
    • MDL-12164 Hiding Course Topics and Switching Roles creates Problem in other Topics
    • MDL-13410 Course view misaligned
    • MDL-17450 Display of blocks and topic section not correct in 2.0
  • MDL-10522 Hard-coded <br /> used for spacing.
    • MDL-14058 Code includes
      tags in many places, which breaks theming, or makes it more difficult
  • MDL-10681 Popup windows need uniform body class
  • MDL-12093 It is not possible to change the page layout in popup windows
  • MDL-12183 Improve block HTML structure
  • MDL-12191 Let themes know whether this page has blocks.
  • MDL-14061 Add category short names, and an option for categories in the navigation bar.
  • MDL-14305 Class on body to identify the page as Moodle, and a specific site. (Enables sharing of stylesheets, but with a few specific customisations.)
  • MDL-14306 The course category hierarchy should be reflected in CSS classes on the body tag (actually, contextids would let this be done more efficiently).
  • MDL-14539 Replace table layout with div - parhaps a duplicate of MDL-9306.
  • MDL-14632 Increase use of tabs on all mod activities.
  • MDL-14901 Themes can no longer control the separater used in the nav bar.
  • MDL-15400 Sideblocks on "My Moodle" page not conforming to global width
  • MDL-15817 Part course them and part site theme is used when displayng Outline and Complete reports
  • MDL-15959 patch any theme to have a personal visual style (CSS file) for each course - not sure this is a good solution, but it is an interesting requirement.
  • MDL-16244 Support for a drop-down menu bar - Like on moodle.org now.

And the following are the relevant 'Blocks' issues.

  • MDL-12212 META: Complete review and rewrite of Pagelib (and blocks)
  • MDL-12240 Add the $CFG->defaultblocks functions to adminmenu
  • MDL-15946 Add ability to add blocks to Category page
  • MDL-11960 Cannot configure rss block on tag page
  • MDL-11131 Moving blocks causes some blocks to disappear (pinned blocks trouble)
  • MDL-14542 Modification to improve javascript and css header insertion for blocks, modules and filters
  • MDL-5320 Under some circumstances some block_instances aren't deleted...
  • MDL-6692 blocks on forum pages
  • MDL-13582 "Course Sticky Blocks" don't get displayed when the "Show the course blocks" option is chosen when using "Add a resource" > "Compose a web page"
  • MDL-13606 Sticky blocks on tag pages
  • MDL-13627 Blocks - Default Closed View
  • MDL-13708 The instances column, in the blocks management screen, links only to courses, but counts everything
  • MDL-13888 Allow RSS block on MyMoodle pages only for users who can configure it
  • MDL-13891 admin tree block disply in myMoodle controlled by capabilities
  • MDL-15379 No way to exclude core blocks from specific modules if Blocks in Modules is enabled without changing core block code
  • MDL-17447 LOCAL: stickyblocks targets
  • MDL-6024 make hidden blocks visible to teacher
  • MDL-6748 Patch to allow a center position for Moodle blocks
  • MDL-5898 customizable blogs blocks

See also