ibexa

Path

ez publish / technical manual / 4.5 / templates / the pagelayout / the page head


Caution: This documentation is for eZ Publish legacy, from version 3.x to 5.x.

The page head

The standard design contains a page head template that can be used to automatically generate important tags that should be included in the head section of every HTML response. The output of the standard head template (/design/standard/template/page_head.tpl) can be broken down into the following group of tags:

  • Title tag
  • Meta tags
  • Link tags

The following HTML dump shows an example of the output from the standard page head template.

<title>Current / Parent / Top - Site name</title>
 
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="Content-language" content="eng-GB" />
<meta name="author" content="eZ Systems" />
<meta name="copyright" content="eZ Systems" />
<meta name="description" content="Content Management System" />
<meta name="keywords" content="cms, publish, e-commerce, content management, development framework" />
<meta name="MSSmartTagsPreventParsing" content="TRUE" />
<meta name="generator" content="eZ publish" />
 
<link rel="Home" href="/" title="Front page" />
<link rel="Index" href="/" />
<link rel="Top"  href="/" title="Current / Parent / Top - Site name" />
<link rel="Search" href="/content/advancedsearch" title="Search Site name" />
<link rel="Shortcut icon" href="/design/standard/images/favicon.ico" type="image/x-icon" />
<link rel="Copyright" href="/ezinfo/copyright" />
<link rel="Author" href="/ezinfo/about" />
<link rel="Alternate" href="/layout/set/print/content/view/full/64" media="print" title="Printable version" />

Title

The contents of the title tag is based on the location being viewed (the location within either the content node tree or the system itself) and the actual name of the site. The path to the element being viewed is reversed and thus the current element becomes the first component of the title. The components of the path are separated by slashes. When a node is viewed, the path elements will be the actual names of the objects which are encapsulated by the nodes that make up the path up to and including the target node. When a system function is being accessed (for example the log-in view of the user module: "/user/login"), the path will most likely be a reversed version of the module/view combination that was used. The name of the site is appended at the end of the path, separated by a dash. The site name can be configured using the "SiteName" directive in a configuration override for "site.ini".

The example above demonstrates the output of the page head template when a node is being viewed. The name of the object encapsulating the node is "Current". The name of the other objects (encapsulated by the parent node and so on) are "Parent" and "Top". The name of the site is "Site name".

Meta tags

In addition to the actual information contained on a web page, the HTML of the page may also include information about the document itself. This is achieved by making use of so called meta tags. The information given by meta tags is usually not visible when the web page is viewed. However, the meta tags are used by the web browser and miscellaneous search engines that index and rank the contents of web pages. The standard page head template outputs the most commonly used meta tags. It can be broken down into three types of tags:

  • HTTP-EQUIV meta tags
  • Generic meta tags
  • Additional meta tags

HTTP-EQUIV meta tags

Meta tags with an HTTP-EQUIV attribute are equivalent to HTTP headers. These tags usually control the way a browser interprets the document. Tags using this form should have an equivalent effect when specified as an HTTP header. Some web servers automatically translate the contents of these tags to actual HTTP headers. The HTTP-EQUIV meta tags in the page head make sure that the browser (and also search engines) know which character set and language the document uses. The language and character set values are automatically set by eZ publish based on the language and character set that the site uses.

Generic meta tags

The generic meta tags make it possible to reveal meta information about the document itself. Although the specification of meta tags does not define a set of legal meta data properties, it is a common practice to include generic information such as the name of the author, description of the site, copyright notices, keywords, etc. By making use of the "MetaDataArray[...]" directive in a configuration override for "site.ini", the site administrator can set up a custom set of generic meta tags. eZ Publish will loop through and display the name and value of the specified tags. The example above shows the default meta tags that will be used if no custom meta tag configuration is present.

Additional meta tags

The last meta tags set by the standard page head template prevent the usage of smart tags and reveal the name of the software that was used to generate the output.

Link tags

Link tags in the HTML head make it possible to relate the document to other documents. This is done by the way of REL and REV attributes. While REL links are used to establish relationships, REV links are used to establish reverse relationships. Some browsers make use of the link tags in order to produce a navigation bar that can be used to quickly navigate the site. The links tags generated by eZ Publish are specified in the "link.tpl" file within the templates directory of the standard design. The standard page head makes use of the "links.tpl" file. The default output of the standard page head template produces a basic set of links that can be used to navigate to different parts of the site. The following list shows the link tags that the page head generates:

Link

Description

Home

The "Home" link points to the root/start of the site. It will always bring the user back to the front page (for example http://www.example.com).

Index

The "Index" link points to the root/start of the site. It will always bring the user back to the front page (for example http://www.example.com).

Top

The "Top" link points to the root/start of the site. It will always bring the user back to the front page (for example http://www.example.com).

Search

The "Search" link points to the "advanced search" view of the "content" module. It will bring the user to the advanced search interface (http://www.example.com/content/advancedsearch).

Shortcut icon

The "Shortcut icon" defines the location of the favorite/shortcut icon. Most browsers will display this icon in front of URLs in the address field and in the bookmark list. The default shortcut icon is the double square white-orange eZ Systems logo. It can be easily replaced by putting a 16x16 pixel icon file (16 color BMP/Windows Icon Format) called "favicon.ico" in the images folder of a site design.

Copyright

The "Copyright" link points to the "copyright" view of the "ezinfo" module. The default copyright page of eZ publish will be displayed (http://www.example.com/ezinfo/copyright.).

Author

The "Author" link points to the "about" view of the "ezinfo" module. The default about page of eZ publish will be displayed (http://www.example.com/ezinfo/about).

Alternate

The "Alternate" link points to a alternate/printerfriendly version of the page. The printerfriendly version of a page is achieved by making use of the "set" view of the "layout" module. This technique makes it possible to use an alternative pagelayout which is usually stripped for everything (menus, logos, etc.) except the actual content that is being presented.

Link parameters

The links can be completely turned off by passing "enable_link=false()" when including the page head template:

{include uri='design:page_head.tpl' enable_link=false()}

The link to the alternate/print layout can be turned off by passing "enable_print=false()" when including the page head template:

{include uri='design:page_head.tpl' enable_print=false()}

Balazs Halasy (14/09/2010 11:28 am)

Geir Arne Waaler (28/09/2010 10:17 am)

Balazs Halasy, Geir Arne Waaler


Comments

There are no comments.