The page <head> section

We have mentioned that the <head> section of Mara's output to the browser is taken from the theme <head> section, with a few page-specific modifications. Nevertheless it is useful to have a <head> section in pages inasmuch as this allows you to exercise control over certain aspects of page rendering.

A default  <head> section might be:

   <META NAME="description"  CONTENT="">
   <META NAME="keywords" CONTENT="">

Followed by...
<h1>This will be used as a title, if none is found in the head section</h1>
<p>This will be used as a description, if no title is found in the head section</p>

In fact, there is no requirement for discrete head or body sections to exist in a Mara document. Though, if the document contains <!doctype>, <html>, <head> and/or <body> tags, these must follow correct HTML syntax rules.

A custom page <head> section might contain:

   <TITLE>The page head section</TITLE>
   <META NAME="description"  CONTENT="A typical head section, for a Mara page">
   <META NAME="keywords" CONTENT="mara !cms, head, meta tags, editing controls, section hiding">
   <META NAME="cms_doctype" CONTENT="HTML4T">  
   <META NAME="cms_theme" CONTENT="wide_theme">
   <META NAME="cms_menu" CONTENT="top">
   <META NAME="cms_hide" CONTENT="left">
   <META NAME="cms_editlevel" CONTENT="3">
   <META NAME="cms_editors" CONTENT="admin,jsmith">

Editing the head section

From Mara v2.5 on, you can edit the head section of a page online, provided you have page source editing permissions. Log on and activate the online editor. In the editor toolbar, click the top-right button, labelled 'Edit HTML Source.' Pages with a head section will show a two-pane editing window, the upper for page head, the lower for content. If only a single editjng pane is present, the page does not have a head section. Currently, head sections can only be added at page creation from new, or by manually editing an existing page.

After making your changes, click Write Back, or Write & Quit to return to the live page editor. Note that the changes you have made to the head section are not committed to disk until you you save the page. (Bottom left editor toolbar button, or File..Save on the admin bar)

It is also worth mentioning that you cannot remove a head section from a file by deleting all content in the source editor. In that case, the head section will be unaltered. 


Although the title seen in the browser topbar is seldom even noticed by site visitors, it is important in that it is used in bookmarks, and by many searchengines, along with either the first paragraph or the description tag, as the listing entry. Thus, Mara includes code to ensure, as far as possible, that these items are not left out, or unsuitable for use as page listings. 

The title attribute in the page head is used if it is present. If a title is present, the description meta content is also used. If no title is present, then a search is made of the document for the first <Hn> heading tag. This is used as a title. The description is then taken from the first identifiable paragraph in the document. In most cases this results in acceptable titles and descriptions without the need to tediously modify the head sections on a page-by-page basis. In a few cases the automatic search cannot return meaningful text, so in those cases you should enter a title and description manually.

An extremely common webmaster mistake is to reuse a page as a template for a new one on an entirely different subject, but forget to change the title tag. This can have amusing consequences in the search listings! Possibly not so amusing for the professional if the client spots it first, though. Therefore, in Mara the best policy is to leave the title and description meta tags blank, and allow the system to 'use its judgement' in selecting page text for these items. Occasionally this may result in less-than-ideal listings, but in the vast majority of cases the results are good, and the avoidance of titling mistakes is very worthwhile.


It is debatable as to which, if any, search engines use keywords for page ranking these days. However, as good practice any keywords you include in the meta tag should occur somewhere in the page body. If they do not, this may result in a demotion of the page's ranking. Thus, Mara does not carry over the keywords from the theme, as these words may not be present in individual pages. An idea for future development is that of a keyword pool, from which keywords which are relevant to site promotion AND which are present in a given page will be added to the meta tag for that page. This addition  is not however regarded as a priority since it seems that keywords are not greatly relevant to page ranking these days.

Special metas

cms_doctype -allows pages to use a specific document type, overriding the theme's settting.
Useful if you need to import a few legacy pages that don't display well in HTML5. See the theme description for values.
Be aware that this changes the tags inserted by CKEditor as well as the page rendering.

cms_theme -allows pages to use a specific theme. The name is that of the theme directory, without slashes. This only affects the current page.

cms_menu - side is the default. top transforms the quicklink menu into a full dropdown list. Mainly for use on pages without a sidebar.

cms_hide - hides specific areas of the page. banner,top,left,content,right,bottom are the section names. all denotes all except content.

cms_editlevel - Determines the minimum privelege level required to edit this page online. Value 1-5. Default is 1 (all logged-in users.)

cms_editors - A comma-separated list of users who are allowed to edit this page regardless of privelege level. If no cms_editlevel is set, only admins or members of this list can edit the page. If set, cms_editlevel determines the privelege level needed by an nonlisted user.

Other items

IMPORTANT: Stylesheet and javascript code or links placed in the head section will be ignored. You must place these in the page body, or theme head. Such links may however be added to the page head purely for the sake of static page testing outside of Mara.  Any doctype, character-set declaration or author/generator info will likewise only apply to static testing of the page. As previously mentioned, Mara presently only allows a single document type and character-set per website. Page-specific character-sets could be added if the need is seen to exist.


Powered by Mara cms