AddChainItem((string)Loc::getMessage("VINO_BREADCRUMBS_HOME"), SITE_DIR); foreach ($items as $item) { $link = (string)($item[1] ?? ""); if ($link !== "" && str_starts_with($link, "/") && !str_starts_with($link, SITE_DIR)) { $link = SITE_DIR . ltrim($link, "/"); } $APPLICATION->AddChainItem((string)$item[0], $link); } $APPLICATION->IncludeComponent("bitrix:breadcrumb", "vinoteca", [ "START_FROM" => "0", "PATH" => "", "SITE_ID" => SITE_ID, ], false, ["HIDE_ICONS" => "Y"]); } public static function schema(array $chain, string $self): array { $last = count($chain) - 1; $items = []; foreach ($chain as $i => $item) { $link = (string)$item["LINK"]; $items[] = [ "@type" => "ListItem", "position" => $i + 1, "name" => $item["TITLE"], "item" => $i < $last && $link !== "" ? Config::host() . $link : $self, ]; } return [ "@context" => "https://schema.org", "@type" => "BreadcrumbList", "@id" => $self . "#breadcrumb", "itemListElement" => $items, ]; } }