Developers Documentation

×

Warning

301 error for file:https://clearos.com/dokuwiki2/lib/exe/css.php?t=dokuwiki&tseed=82873f9c9a1f5784b951644363f20ef8

User Tools

Site Tools


Table of Contents

Theming Head Section

The HTML page head provides a hook for including elements between the tags. This is the place to pull in theme elements that will display on most or all of the pages:

  • Favorite icon
  • Style sheets / CSS
  • Javascript that is required in (best practice: see Javascript)

The ClearOS theme engine uses jQuery for processing page elements. If your theme requires jQuery, there is no need to include it. You should also know that individual ClearOS Apps can pull in additional javascript and CSS. Maintaining these additional App assets is up to the developer.

Hook

The theme engine loads the core/head.php file in your theme directory and expects to find the theme_page_head hook defined. Your hook should return the necessary lines for your theme.

The parameter theme_path should be used instead of hard-coding your theme path (see example). This makes it possible to map the URL and path to alternate directory locations. Why do we do this? This flexibility will allow you to test different versions of your theme without having to change any code.

Examples

function theme_page_head($theme_path)
{
    return "


 




";
}
content/en_us/dev_theming_head_section.txt · Last modified: 2015/03/02 10:07 by dloper

https://clearos.com/dokuwiki2/lib/exe/indexer.php?id=content%3Aen_us%3Adev_theming_head_section&1710813813