Views: 11035
Last Modified: 14.07.2014
Setting up and Displaying Page Header
Page header may be set up as follows.
- When editing the document with the help of the incorporated editor (in the Text, PHP, or HTML mode). In this case, the page header is set by way of substituting the following function in the code:
<?
$APPLICATION->SetTitle("About Company");
?>
- Document header can be set dynamically by one of the components located on the page. In the example below, the name of the current information block is used as a page header:
<?
$arIBlock = GetIBlock($ID, "news")
$APPLICATION->SetTitle($arIBlock["NAME"]);
…
?>
The document header is displayed by placing the function of ShowTitle()
at the place of page header display:
<H1><?$APPLICATION->ShowTitle()?></H1>
If the function of ShowTitle()
uses the parameter false for page header display, it means that there is no need to check the value of the title property to set the page header (e.g., Additional header (web browser window header)).
<H1><?$APPLICATION->ShowTitle(false)?></H1>
I.e. the header set by the SetTitle()
function will be used as a page header.
Note: For more information about the ShowTitle(false) function, please refer to the page
Work examples.
Set Up and Display of Web Browser Window Header
Web browser window header is displayed using the ShowTitle()
code located in the <head>
area of the site design template.
<head><title><?$APPLICATION->ShowTitle()?></title></head>
There are various ways to set web browser window header. By default, the header is set in the title property of the page (e.g., Additional header (web browser window header)). If the value of this property is not indicated the browser window header will be set as equal to the current page header.
Note: Browser window header can also be set using the function of
SetPageProperty()
or in the public part of the site. For more details, please refer to the page
Work examples.
Attention! If several identical header setting functions or components are located on the page, the header set in the last (the bottommost on the page) function/component will be used.