Skip to content

Instantly share code, notes, and snippets.

@EvilWolf EvilWolf/header.php
Last active Oct 11, 2017

Embed
What would you like to do?
Заголовок шаблона для Битрикс
<?php
use Bitrix\Main\Page\Asset;
$AssetManager = Asset::getInstance();
//$AssetManager->addCss();
//$AssetManager->addJs();
//$AssetManager->addString();
?>
<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="UTF-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title><? $APPLICATION->ShowTitle()?></title>
<?php
// Assets
// 0. Fonts
$AssetManager->addString('<link href="https://fonts.googleapis.com/css?family=Cuprum:400,400i,700,700i&amp;subset=cyrillic" rel="stylesheet">');
// 1. Stylesheet
$AssetManager->addCss(SITE_TEMPLATE_PATH . '/css/normalize.css');
$AssetManager->addCss(SITE_TEMPLATE_PATH . '/css/grid.css');
$AssetManager->addCss(SITE_TEMPLATE_PATH . '/css/main.css');
// 2. Libraries and Scripts
// jQuery and Modernizr
$AssetManager->addString('<script src="https://cdnjs.cloudflare.com/ajax/libs/modernizr/2.8.3/modernizr.min.js"></script>');
$AssetManager->addString('<script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>');
// flickity
$AssetManager->addString('<link rel="stylesheet" href="https://unpkg.com/flickity@2.0/dist/flickity.min.css">');
$AssetManager->addString('<script src="https://unpkg.com/flickity@2.0/dist/flickity.pkgd.min.js"></script>');
$AssetManager->addJs(SITE_TEMPLATE_PATH . '/js/main.js');
// 3. Join BX and head
CJSCore::Init(array("fx")); // fix BX not defined;
$APPLICATION->ShowHead();
?>
</head>
<body>
<? $APPLICATION->ShowPanel() ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.