Вы находитесь на странице: 1из 37

TEMPLATE DEVELOPMENT

Robert Jacobi, Arc Technology Group

Tuesday, February 17, 2009

THE PIECES
Directory

Structure

templateDetails.xml params.ini index.php style.css

Tuesday, February 17, 2009

DIRECTORY STRUCTURE

http://docs.joomla.org/Tutorial:Creating_a_basic_Joomla

%21_template
Template css/ images/

Name for Root

Tuesday, February 17, 2009

DIRECTORY STRUCTURE

http://docs.joomla.org/Tutorial:Creating_a_basic_Joomla

%21_template
Template css/ images/

Name for Root

Tuesday, February 17, 2009

IMPORTANT FILES
templateDetails.xml* index.php* template_thumbnail.png params.ini style.css index.html

Tuesday, February 17, 2009

IMPORTANT FILES
templateDetails.xml* index.php* template_thumbnail.png params.ini style.css index.html

Tuesday, February 17, 2009

TEMPLATEDETAILS.XML

<?xml

version="1.0" encoding="utf-8"?>

<!DOCTYPE

install PUBLIC "-//Joomla! 1.5//DTD template 1.0//EN" "http://dev.joomla.org/xml/1.5/template-install.dtd"> version="1.5" type="template">

<install

Tuesday, February 17, 2009

DESCRIPTION ELEMENTS
<name>tba</name> <creationDate>2009-02-01</creationDate> <author>Arc Technology

Group</author>

<authorEmail>solutions@arctg.com</authorEmail> <authorUrl>http://www.arctg.com</authorUrl> <copyright>Arc Technology

Group</copyright>
6

Tuesday, February 17, 2009

FILES AND POSITIONS

<files><filename>relative_path/file_name</filename></files> <positions><position>name</position></positions>

Tuesday, February 17, 2009

PARAMS

http://docs.joomla.org/Tutorial:Template_parameters <params><param

...>...</param></params>

Tuesday, February 17, 2009

PARAMS AND PARAMS.INI


<params> <param

name="templateColor" type="list" default="white" label="Template Color" description="Choose the template color."> <option value="white">White</option> <option value="black">Black</option> </param>

</params>

Tuesday, February 17, 2009

PARAMS AND PARAMS.INI

templateColor=white

Tuesday, February 17, 2009

10

PARAMS AND PARAMS.INI

templateColor=white

Tuesday, February 17, 2009

10

INDEX.PHP
Restrict <?php

access and describe document

defined( '_JEXEC' ) or die( 'Restricted access' );?>

<!DOCTYPE

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

<html

Tuesday, February 17, 2009

INDEX.PHP
Add

header code and css

<head> <jdoc:include <link

type="head" />

rel="stylesheet" href="<?php echo $this->baseurl ?>/ templates/mynewtemplate/css/style.css" type="text/css" />

</head>

Tuesday, February 17, 2009

12

INDEX.PHP
Add

modules and component

<body>

<jdoc:include type="modules" name="top" /> <jdoc:include type="component" /> <jdoc:include type="modules" name="footer" />

</body></html>

Tuesday, February 17, 2009

13

INDEX.PHP
Add

modules and component

<body>

<jdoc:include type="modules" name="top" /> <jdoc:include type="component" /> <jdoc:include type="modules" name="footer" />

</body></html>

Tuesday, February 17, 2009

13

ZIP IT!

Zip

up the new template directory template on to your Joomla instance

Install

Tuesday, February 17, 2009

14

ZIP IT!

Zip

up the new template directory template on to your Joomla instance

Install

Tuesday, February 17, 2009

14

ZIP IT!

Zip

up the new template directory template on to your Joomla instance

Install

Tuesday, February 17, 2009

14

TAYLOR BRUCE INDEX.PHP


Header <link

changes from basic template

rel="stylesheet" href="<?php echo $this->baseurl . '/ templates/' . $this->template . '/css/style.css' ?>" type="text/css" /> rel="stylesheet" href="<?php $tplColor = $this->params->get( 'templateColor' ); echo $this->baseurl . '/templates/' . $this->template . '/css/' . $tplColor . '.css'; ?>" type="text/css" />
15

<link

Tuesday, February 17, 2009

TAYLOR BRUCE INDEX.PHP

<?php

echo $this->baseurl . '/templates/' . $this->template . '/ images/taylor-bruce-logo.gif' ?> if($this->countModules('debug')) : ?> <jdoc:include type="modules" name="debug" /> <?php endif; ?> echo JHTML::_('date', 'now', '%Y' ) ?>

<?php

<?php

Tuesday, February 17, 2009

16

TAYLOR BRUCE INDEX.PHP

<?php

echo $this->baseurl . '/templates/' . $this->template . '/ images/taylor-bruce-logo.gif' ?> if($this->countModules('debug')) : ?> <jdoc:include type="modules" name="debug" /> <?php endif; ?> echo JHTML::_('date', 'now', '%Y' ) ?>

<?php

<?php

Tuesday, February 17, 2009

16

ADD IMAGES

Are

these listed in templateDetails.xml?

Tuesday, February 17, 2009

17

ADD IMAGES

Are

these listed in templateDetails.xml?

Tuesday, February 17, 2009

17

ADD CSS
Make

sure about templateDetails.xml

style.css black.css white.css editor.css

Tuesday, February 17, 2009

18

ADD CSS
Make

sure about templateDetails.xml

style.css black.css white.css editor.css

Tuesday, February 17, 2009

18

ADD CSS
Make

sure about templateDetails.xml

style.css black.css white.css editor.css

Tuesday, February 17, 2009

18

ADD CSS
Make

sure about templateDetails.xml

style.css black.css white.css editor.css

Tuesday, February 17, 2009

18

ADD CSS
Make

sure about templateDetails.xml

style.css black.css white.css editor.css

Tuesday, February 17, 2009

18

TBA HOME PAGE

FrontPage Extended

SlideShow (Commercial) Menu (GPL)

Tuesday, February 17, 2009

19

TBA HOME PAGE

FrontPage Extended

SlideShow (Commercial) Menu (GPL)

Tuesday, February 17, 2009

19

ADVANCED TOPICS STYLES


Module

Styles the raw Module content with no wrapping. the module in a table. the module as a table inside an outer table. the module wrapped in div tags.

none. Output table. Output horz. Output

xhtml. Output

rounded. Output

the module wrapped in nested div tags to support rounded corners.


20

Tuesday, February 17, 2009

ADVANCED TOPICS PARAMETERS

For

template customization in commercial templates

Common

Tuesday, February 17, 2009

21

ADVANCED TOPICS PARAMETERS

For

template customization in commercial templates

Common

Tuesday, February 17, 2009

21

ADVANCED TOPICS OUTPUT OVERRIDE

http://developer.joomla.org/tutorials/165-understanding-

output-overrides-in-joomla.html
Component Module

Overrides

Overrides

Tuesday, February 17, 2009

22

THANK YOU

Tuesday, February 17, 2009

23

Вам также может понравиться