Note:

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

Address Bar: Difference between revisions

From MoodleDocs
m (New page: On the web, URLs are a part of the user interface and some users routinely use the address bar to navigate sites (for example, for getting higher in the hierarchy if they don't find an eas...)
 
m (what a horrible sentence it was I found - fixed)
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
On the web, URLs are a part of the user interface and some users routinely use the address bar to navigate sites (for example, for getting higher in the hierarchy if they don't find an easier way in the site navigation).
[[ Moodle User Interface Guidelines|Moodle User Interface Guidelines]] > '''Address Bar'''


In Moodle, The form of URLs is determined by a motivation to make work easy for developers, which is important in an open source community to make it easy to edit different parts of Moodle. Usually it is enough to just look at the URL to know which PHP file to edit.  
On the web, URLs (web addresses, ''Uniform Resource Locator'') are a part of the user interface and some users routinely use the address bar to navigate sites (for example, for getting higher in the hierarchy if they don't find an easier way in the site navigation).


As a consequence, the site hierarchy is not replected in the URL - the end user is not considered the primary user of URLs, unlike usually recommended.  
In Moodle, The form of URLs is determined by a motivation to make work easy for developers, which is important in an open source community. Usually it is enough to just look at the URL to know which PHP file to edit.
 
As a consequence, the site hierarchy is not reflected in the URL - the end user is not considered the primary user of URLs, unlike usually recommended.  


Examples
Examples
Line 13: Line 15:
# No underscores in parameter names or files names
# No underscores in parameter names or files names
# Never use two words when one would do.
# Never use two words when one would do.
===Activity modules===
*''index.php'' - lists all instances for that module in a course
*''view.php'' - displays a particular instance
*''config.html'' - configure an instance of the module
===Blocks===
*''config.html'' - configure an instance of the block
[[Category:Moodle User Interface Guidelines]]

Revision as of 20:30, 18 May 2010

Moodle User Interface Guidelines > Address Bar

On the web, URLs (web addresses, Uniform Resource Locator) are a part of the user interface and some users routinely use the address bar to navigate sites (for example, for getting higher in the hierarchy if they don't find an easier way in the site navigation).

In Moodle, The form of URLs is determined by a motivation to make work easy for developers, which is important in an open source community. Usually it is enough to just look at the URL to know which PHP file to edit.

As a consequence, the site hierarchy is not reflected in the URL - the end user is not considered the primary user of URLs, unlike usually recommended.

Examples

  • Course front pages are at moodlesite/course/view.php?id=2
  • Regardless of the course an activity module instance, such as a forum belongs to, it's URL is moodlesite/mod/forum/view.php?id=13

Guidelines

  1. URLs should be as short as possible.
  2. No underscores in parameter names or files names
  3. Never use two words when one would do.

Activity modules

  • index.php - lists all instances for that module in a course
  • view.php - displays a particular instance
  • config.html - configure an instance of the module

Blocks

  • config.html - configure an instance of the block