Создание шаблона для joomla
Этапы создания шаблона:
создание разметки/представления, которые лягут в основу будущего шаблона: html/css
создание структуры папок/директорий и файлов будущего шаблона
преобразование файла разметки (html) из пункта 1 в главный файл шаблона с расширением php, путем добавления инструкций языка php и инструкций joomla (конструкций <jdoc..>)
формирование файла-инструкции templateDetails.xml, необходимого для инсталляции шаблона в joomla
создание zip-файла шаблона
1) http://csstemplater.com/
2) Создаем директорию css
копируем туда style.css
переименовываем его в template.css
index.html переименовываем в разрешение php
добавляем в корень файл templateDetails.xml
3-4)создаем файл index.html и пишем там:
<!DOCTYPE html>
<html>
<body bgcolor='#ffffff'>
</body>
</html>
открываем templateDetails.xml
изменяем:
<name>own_template</name>
убираем внутри тега description инфу
<files>
<folder>css</folder>
<filename>index.html</filename>
<filename>index.php</filename>
<filename>templateDetails.xml</filename>
</files>
папки и файлы,которые есть на сайте.поэтому нужно точно тут прописать нужные или убрать лишние
строчки,защищающие файл от запуска не из joomla
в файле index.php добавляем в самом начале
<?php
defined('_JEXEC') or die;
?>
<html xmlns="http://www.w3.org/1999/xhtml">
добавляем <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $this->language;?>" lang="<?php echo $this->language;?>">
добавляем <jdoc:include type="hedd"/> в head
изменяем <link rel="stylesheet" href="<?php echo $this->baseurl;?>/templates/<?php echo $this->template;?>/css/template.css" type="text/css" media="screen, projection" /> на директорию css
Целый общий вид шапки:
<?php
defined('_JEXEC') or die;
?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $this->language;?>" lang="<?php echo $this->language;?>">
<head>
<jdoc:include type="head" />
<link rel="stylesheet" href="<?php echo $this->baseurl;?>/templates/<?php echo $this->template;?>/css/template.css" type="text/css"/>
</head>
5) Определим расположение компонента (основное содержимое контента):
<jdoc:include type="component"/>
<div id="container">
<div id="content">
<jdoc:include type="component"/>
</div><!-- #content-->
</div><!-- #container-->
Размещение модулей (всё остальное)
left — position-7
right — position-6
top — position-1
footer — position-11
В templateDetails.xml убираем лишнее:
<positions>
<position>position-1</position>
<position>position-6</position>
<position>position-7</position>
<position>position-11</position>
</positions>
удаляем дальше всё — и язык, и config
остается в конце после этого только закрыающийся тег </extension>
возвращаемся в index.php
<header id="header">
<jdoc:include type="modules" name="position-1" style="xhtml"/>
</header>
и так далее
общий вид тела:
<body>
<div id="wrapper">
<header id="header">
<jdoc:include type="modules" name="position-1" style="xhtml" />
</header><!-- #header-->
<section id="middle">
<div id="container">
<div id="content">
<jdoc:include type="component" />
</div><!-- #content-->
</div><!-- #container-->
<aside id="sideLeft">
<jdoc:include type="modules" name="position-7" style="xhtml"/>
</aside><!-- #sideLeft -->
<aside id="sideRight">
<jdoc:include type="modules" name="position-6" style="xhtml"/>
</aside><!-- #sideRight -->
</section><!-- #middle-->
<footer id="footer">
<jdoc:include type="modules" name="position-11" style="xhtml"/>
</footer><!-- #footer -->
</div><!-- #wrapper -->
</body>
Иконку сайта и превьюшку с названием (template_thumbnail.png) добавляем в корень, дописываем файлы в templateDetails.xml
делаем заново зип и грузим.
Чтобы деинсталлировать старый шаблон — заходим в менеджер расширений — управлением — ищем по названию старый — галка — деинсталлировать
PhpBB
http://localhost/phpBB3/
localhost
root
root
phpbb_
admin
administrator