This repository was archived by the owner on Jun 17, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Уникальный класс #53
Copy link
Copy link
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Сделать для body уникальный класс для каждой страницы
Вот я делал когда-то уникальный метатег. Но тут надо добавить название компонента и въюху или на их основе какой-то хеш или сумму цифр.
$app = Factory::getApplication();
$document = Factory::getDocument();
$input = $app->input;
$menu = $app->getMenu();
$menuItem = $menu->getActive();
$id = $input->getCmd('id');
$ids = [];
$admin = $app->isClient('administrator');
if($admin)
{
return;
}
if(!empty($menuItem->id))
{
$ids[] = $menuItem->id;
}
if(!empty($id))
{
$ids[] = $id;
}
if(method_exists($document, 'addCustomTag'))
{
$document->addCustomTag('<meta name="PageID" content="' . implode('-', $ids). '" />');
}
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request