Skip to content
This repository was archived by the owner on Jun 17, 2024. It is now read-only.

Уникальный класс #53

@dmitriitux

Description

@dmitriitux

Сделать для 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

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions