Notes on how BeckCMS should work when displaying a web page.
This page tries to describe the main engine of BeckCMS. This is the part of BeckCMS that turns the templates and page content into a final web page that is then presented to the web browser for rendering.
The other three main functions of BeckCMS are displaying a page for editing, posting an edited page or posting from the feedback page.
First lets describe displaying a page for viewing:
- Set the global variable $default_template == "$default_template".
- This is so if no template is defined in the page being displayed, the default template will be used.
- PASS 1:
- Process the page content file that was requested for viewing by the web user.
- Load $page_content with the file specified in $file_request_page.
- Set $content_input == $page_content.
- Process $content_input through content processor content processor should:
- Output all non BeckCMS tag content to $content_output as is.
- Decode and process all BeckCMS tags.
- Set $content == $page_content.
- At this point the content of the page has been converted into html and no longer contains any BeckCMS tags.
- Nothing has been output by the server.
- The page content still needs to be combined with the template.
- PASS 2:
- Process the template file that will be combined with the page content to form the final web page sent to the web user.
- Load $content_input with the file specified in $page_template.
- Process $content_input through content processor.
- Content processor should:
- Will perform the same operations as it did above for $page_content.
- The [var $content] tag needs to be processed here.
- The template contains this tag so BeckCMS knows where to insert the page content into the template.
- PASS 3:
- BeckCMS inserts the page content into the page template at the location indicated by [var $content].
- The web page is now complete and is echoed to the server for serving to the web client.