Using the page Head Declarations field
The Head Declarations field on the Create/Edit Page form (the Head & Blocks tab) allows you to separate page-specific HEAD declarations from the common templates code. In this field you can define code which you want to be rendered in the page HEAD element - for example SCRIPT or CSS resource references. Then you can output the content defined in the field using the $this->render_head() call in your page templates.
You can invoke the $this->render_head() method inside page templates, pages and partials. Example page Head content:

Example layout code:
<html>
<head>
<title><?= h($this->page->title) ?></title>
<? $this->render_head() ?>
</head>
<body>
<? $this->render_page() ?>
</body>
</html><html>
<head>
<title>{{ this.page.title }}</title>
{{ render_head() }}
</head>
<body>
{{ render_page() }}
</body>
</html>See also:
- Cms_Controller class
Next: Using the page blocks feature
Previous: Creating a partial
Return to Creating pages basics
