Инструменты пользователя

Инструменты сайта


typolight

Как использовать пользовательские шаблоны страниц

Там было много просьб о том, как использовать пользовательские шаблоны страниц вместо стандартного fe_page шаблона. Сегодня я собираюсь показать Вам, как интегрировать шаблон из OSWD (с открытым исходным кодом веб-дизайн). После того, как вы знаете, как это работает, вы можете также включить YAML шаблонов или создавать свои собственные.

Смотреть этот учебник, как комментирует screencast Скачать файл шаблона

Я собираюсь использовать голубой Свобода шаблона, чтобы показать Вам, как это делается.

Прежде всего, загрузите шаблон и распаковать архив в папку TYPOlight.

Затем скопируйте файл templates/bluefreedom2/index.html шаблоны для каталога, и переименовать его в fe_bluefreedom2.tpl.

Теперь вы должны иметь следующие файлы и папки:

  • templates/fe_bluefreedom2.tpl
  • bluefreedom2/style.css
  • bluefreedom2/images

Настройка шаблона заголовка

Далее, мы должны настроить файл шаблона смысл мы должны добавить некоторые символы, которые будут заменены TYPOlight содержание. Мы будем делать это поэтапно, начиная с заголовка.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Blue Freedom by minimalistic-design.net</title>
<meta http-equiv="Content-Language" content="English" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" type="text/css" href="style.css" media="screen" />
</head>

Есть кое-что мы должны изменить.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="<?php echo $this->language; ?>">
<head>
<base href="<?php echo $this->base; ?>" />
<title><?php echo $this->title; ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $this->charset; ?>" />
<link rel="stylesheet" type="text/css" href="bluefreedom2/style.css" media="screen" />
</head>

В основном, там были три важных изменения. Во-первых, мы добавили базе тегов, которые требуют TYPOlight.

<base href="<?php echo $this->base; ?>" />
<base href="<?=$this->base;?>" />
<title><?php echo $this->title; ?></title>

Добавление TYPOlight конкретных разметки

Если вы хотите использовать все TYPOlight функций (например, лайтбоксе и сортировать таблицы),

вы должны добавить еще несколько тегов, которые можно в основном скопировать и вставить в страницу по умолчанию шаблон fe_page. Полная страница головой выглядит так:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="<?php echo $this->language; ?>">
<!--

    This website was built with TYPOlight :: open source web content management system
    TYPOlight was developed by Leo Feyer (leo@typolight.org) :: released under GNU/GPL
    Visit project page http://www.typolight.org for more information

//-->
<head>
<base href="<?php echo $this->base; ?>" />
<title><?php echo $this->title; ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $this->charset; ?>" />
<meta name="description" content="<?php echo $this->description; ?>" />
<meta name="keywords" content="<?php echo $this->keywords; ?>" />
<?php echo $this->robots; ?>
<script type="text/javascript" src="plugins/tablesort/js/tablesort.js"></script>
<script type="text/javascript" src="plugins/mootools/mootools.js"></script>
<script type="text/javascript" src="plugins/slimbox/js/slimbox.js"></script>
<script type="text/javascript" src="plugins/ufo/ufo.js"></script>
<link rel="stylesheet" href="plugins/slimbox/css/slimbox.css" type="text/css" media="screen" />
<link rel="stylesheet" href="plugins/tablesort/css/tablesort.css" type="text/css" media="screen" />
<link rel="stylesheet" type="text/css" href="tl_files/bluefreedom2/style.css" media="screen" />
<?php echo $this->head; ?>
</head>
typolight.txt · Последнее изменение: 2022/02/17 18:55 (внешнее изменение)