string CMain::GetMeta( string property_id, string meta_name = false )
The method GetMeta retrieves the page property decorated in the <meta> tag. If the page does not have the required property, the method searches for the one in parent sections recursively. If the method fails to find the required property, an empty string is returned.
Parameter | Description |
---|---|
property_id | Identifier of the page or section property whose value will be rendered in the content attribute of the <meta> tag:
<meta content="value" ...>
|
meta_name | Contents of the name attribute of the <meta> tag:
<meta name="meta_name" ...>
Optional; by default, the property_id name is used. |
<? $meta_keywords = $APPLICATION->GetMeta("keywords_prop", "keywords"); if (strlen($meta_keywords)>0) echo $meta_keywords; ?>
© 2001-2005 Bitrix | Bitrix Site Manager - Content Management & Portal Solutions |