Note: You are currently viewing documentation for Moodle 2.0. Up-to-date documentation for the latest stable version is available here: How Moodle outputs HTML.

Obsolete:How Moodle outputs HTML: Difference between revisions

From MoodleDocs
No edit summary
(Shifted to dev docs)
 
(9 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{Moodle 2.0}}
#REDIRECT [[:dev:How Moodle outputs HTML]]
 
If you think about the HTML that is output by Moodle, then you can split it into two parts:
# the parts like the header and the user-interface, that are generated automatically by the Moodle code and the themes; and
# the bits like the contents of forum posts and labels that are input by the users.
This page is about the bits of output that are generated automatically. It explains how that happens.
 
{{stub}}
Actually, please don't start editing this page yet. I will be working on it as and after I have work on the code.--[[User:Tim Hunt|Tim Hunt]] 03:30, 17 June 2009 (UTC)
 
 
==History==
 
Most of what is described here is new in Moodle 2.0. The work that lead to this new system is described in [[Development:Theme engines for Moodle?]] and [[Development:Navigation 2.0 implementation plan]]. Those documents were both written before the new system was developed and shows how the thinking evolved.
 
If you are familiar with Moodle 1.9 or before, and just wish to update your existing code, you may wish to read [[Development:Migrating your code to the 2.0 rendering API]].
 
 
==Overview==
 
I said above that this page was about the parts of the output that were automatically generated by Moodle code. We can break those bits of output down further:
# The overall layout of the page including the header and the footer. This is generated from the layout template provided by the theme (for example theme/standard/layout.php).
# The blocks that can appear in various places on the page. Where the blocks can appear on the page is determined by the theme layout. Which blocks appear where on which pages is configured by the user. The code that manages this is in blocklib.php. Finally, the contents of the blocks is a mixture of user-entered content and automatically generated content.
# The main content in the middle of the page. This is generated by the particular script, for example mod/forum/view.php using the output libraries. (Moodle mostly uses a transaction script architecture.)
 
 
==Basic HTML output and $OUTPUT==
 
 
 
 
==Themes==
 
 
===Theme config.php===
 
===Layout templates===
 
===Ways themes can change other parts of the HTML===
 
====Basic themes====
 
====Minor changes to the HTML====
 
====Templated themes====
(Experimental)
 
$THEME gets initialised the frist time you use $OUTPUT, or the first time you refer to $PAGE->theme
 
 
==Blocks==
 
 
 
==Plugin-specific output==
 
 
==See also==
 
* [[Development:Theme_engines_for_Moodle%3F]]
* [[Development:Navigation_2.0_implementation_plan]]
* [[Development:Navigation_2.0]]
 
{{CategoryDeveloper}}

Latest revision as of 08:48, 27 July 2011