Header
From Cyclone3 Wiki
m |
|||
(2 intermediate revisions not shown.) | |||
Line 1: | Line 1: | ||
- | ''' | + | * Extension: '''*.header''' (see [[Naming conventions]]) |
+ | * Extension: '''_dsgn''' directory | ||
+ | * Mandatory: '''yes''' (at least 'default.header' must exist) | ||
+ | * Caching: cached, needs service restart to reload | ||
- | + | ||
+ | The service header is the main document frame. It usually specifies HTML HEAD's tags, like title, meta tags, stylesheet and rss links, or inclusion of javascript files. It also can specify additional parameters for the body element. | ||
+ | |||
+ | Here's an example | ||
+ | |||
+ | %HEADER=( | ||
+ | 'head' => | ||
+ | { | ||
+ | 'title' => "MyCompany Website - Home of the best", | ||
+ | |||
+ | 'meta' => | ||
+ | { | ||
+ | 'pragma' => "no-cache", | ||
+ | 'expires' => "0" | ||
+ | }, | ||
+ | |||
+ | 'link' => | ||
+ | [ | ||
+ | { | ||
+ | 'href' => "$tom::H_css/standard.screen.css", | ||
+ | 'rel' => "stylesheet", | ||
+ | 'type' => "text/css", | ||
+ | 'media' => "screen, tv, projection" | ||
+ | }, | ||
+ | { | ||
+ | 'href' => "$tom::H_css/main.screen.css", | ||
+ | 'rel' => "stylesheet", | ||
+ | 'type' => "text/css", | ||
+ | 'media' => "screen, tv, projection" | ||
+ | } | ||
+ | ], | ||
+ | |||
+ | 'script' => | ||
+ | [ | ||
+ | { | ||
+ | 'type' => "text/javascript", | ||
+ | 'src' => "$tom::H_media/tpl/jquery/jquery.min.js" | ||
+ | }, | ||
+ | { | ||
+ | 'type' => "text/javascript", | ||
+ | 'src' => "$tom::H_media/tpl/swfobject/swfobject.js" | ||
+ | }, | ||
+ | { | ||
+ | 'type' => "text/javascript", | ||
+ | 'src' => "$tom::H_media/tpl/lightbox/lightbox.js" | ||
+ | }, | ||
+ | ], | ||
+ | }, | ||
+ | |||
+ | 'body' => | ||
+ | { | ||
+ | } | ||
+ | ); | ||
+ | |||
+ | 1; | ||
+ | |||
+ | The '''$tom::media''' variable is a path definition of media location. It is defined in the domain service's configuration files, along with other useful values you can use here, or anywhere else in the framework - in modules, their design, body templates ... For instance '''$tom::H_www''', which can be used to direct a link to the webpage's root url. | ||
+ | |||
+ | Note: Don't forget the '''1;''' line at the end ;) | ||
+ | |||
+ | Note: Do not use the older '''*.dsgn''' extension for this kind of file, it is obsolete and its support will be removed soon. | ||
[[Category:Framework]] | [[Category:Framework]] | ||
[[Category:Glossary]] | [[Category:Glossary]] |
Current revision
- Extension: *.header (see Naming conventions)
- Extension: _dsgn directory
- Mandatory: yes (at least 'default.header' must exist)
- Caching: cached, needs service restart to reload
The service header is the main document frame. It usually specifies HTML HEAD's tags, like title, meta tags, stylesheet and rss links, or inclusion of javascript files. It also can specify additional parameters for the body element.
Here's an example
%HEADER=( 'head' => { 'title' => "MyCompany Website - Home of the best", 'meta' => { 'pragma' => "no-cache", 'expires' => "0" }, 'link' => [ { 'href' => "$tom::H_css/standard.screen.css", 'rel' => "stylesheet", 'type' => "text/css", 'media' => "screen, tv, projection" }, { 'href' => "$tom::H_css/main.screen.css", 'rel' => "stylesheet", 'type' => "text/css", 'media' => "screen, tv, projection" } ], 'script' => [ { 'type' => "text/javascript", 'src' => "$tom::H_media/tpl/jquery/jquery.min.js" }, { 'type' => "text/javascript", 'src' => "$tom::H_media/tpl/swfobject/swfobject.js" }, { 'type' => "text/javascript", 'src' => "$tom::H_media/tpl/lightbox/lightbox.js" }, ], }, 'body' => { } ); 1;
The $tom::media variable is a path definition of media location. It is defined in the domain service's configuration files, along with other useful values you can use here, or anywhere else in the framework - in modules, their design, body templates ... For instance $tom::H_www, which can be used to direct a link to the webpage's root url.
Note: Don't forget the 1; line at the end ;)
Note: Do not use the older *.dsgn extension for this kind of file, it is obsolete and its support will be removed soon.