Vous êtes sur la page 1sur 14

Crersontemplate

pourJoomla!1.5

Date:13/10/08
Auteur:Ced

http://www.joomlack.fr.nf

Copyright:GNU/GPL

Annexes
Tabledesmatires
Versions................................................................................................................................................3
Contributeurs........................................................................................................................................3
LespositionsstandardsdeJoomla!.....................................................................................................4
ConvertirsontemplateJ!1.0enJ!1.5....................................................................................................5
Modledebasedufichierindex.php....................................................................................................7
Rappel...................................................................................................................................................9
Contrled'accsaufichierindex.php.............................................................................................9
DfinitionXHTML.........................................................................................................................9
Liaisonaveclafeuilledestyle........................................................................................................9
Appeldel'entte(balisesmeta,title,...)........................................................................................9
Contenuprincipal(auparavantMainBodydansJoomla1.0)..........................................................9
Bannire..........................................................................................................................................9
Autresmodules...............................................................................................................................9
Pieddepage....................................................................................................................................9
ChemindevisiteouFild'Arianeoupathway.................................................................................9
Lesstylesdesmodules........................................................................................................................10
StylesCSS..........................................................................................................................................11
SourcesetLiens..................................................................................................................................13
Sources...........................................................................................................................................13
Liens...............................................................................................................................................13
LiensrelatifsaulangageCSS.........................................................................................................13
Miseenforme................................................................................................................................13
Menus.............................................................................................................................................13
GnrateuronlinedeCSSetoutilsindispensables........................................................................14
ServicedevalidationCSSduW3C...............................................................................................14
LiensrelatifsJoomla!..................................................................................................................14
Crationdemodule...................................................................................................................14
Gnrateurdetemplateonline...................................................................................................14
Outilspourvousaiderdanslacrationd'untemplate...............................................................14

Versions
Bta1(16/10/08):premiresortiedututo...
Bta2(20/10/08):
ajoutdecouleurpourlecode
rectificationdequelqueserreursetajoutd'informations
ajoutdesannexes
V1.0(21/10/08):
ajoutparamtresRTL
hackspourlesnavigateurs
misejourdesannexes
V1.1(09/11/08):
misejourdeliensdanslesannexes
ajoutdurcap'pourlesnuls
misejourdeshacksetdivimbriqus
misejourducodedelapartiebody(ilmanquaitleheaderetletopmenu)
ajoutdefonctionnalitspourletopmenu

Contributeurs
Sourcesetliens:Millenniums
http://www.annuaire2tutos.com/
Merciaussighazal,cbia,ettouslesautresquimedonnentunretoursurmontravail...

LespositionsstandardsdeJoomla!

left:gaucheducontenuprincipalmain.
right:droiteducontenuprincipalmain.
top:enhautducontenuprincipalmain(moduledenews,ouparfoismenushorizontaux).
bottom:enbasducontenuprincipalmain.
inset:Modulesplacsdanslesecteurdinsertion.
banner:bannire.
header:enttedelapage.
footer:pieddepage.
newsflash:affichagedesNewsflashs.
legals:informationslgales.
[pathway:Positiondupathway=chemindenavigation(remplacdansJoomla!1.5parlemodule
breadcrumbs)]
breadcrumb:pourpublierlemodulebreadcrumbquiremplacelancienpathway.=cheminde
navigation[NOUVEAUDANSJOOMLA1.5]
menu:menu.navigation[NOUVEAUDANSJOOMLA1.5]
user1:positionlibrepardfaut:moduleLatestNews
user2:positionlibrepardfaut:modulePopular
user3:positionlibrepardfaut:moduleTopMenu
user4:positionlibrepardfaut:moduleSearch
user5:positionlibre.
user6:positionlibre.
user7:positionlibre.
user8:positionlibre.
user9:positionlibre.
advert1:pourlespublicits.Certainslesutilisentpourlesbannires
advert2:idem
advert3:idem
icon:Positioncertainementdestinedesicnes.
debug:Emplacementdestinauxinformationsrenvoyesparledbuggeur(pourlamiseenplace
dumodle).Cettepositionestabsentedansdenombreuxtemplates(ellepeuttresupprime
lorsquelemodleestaupoint).Lorsquelleestprsenteelleestgnralementsitueaprslefooter.
submenu:[NOUVEAUDANSJOOMLA1.5]voirutilisation
status:[NOUVEAUDANSJOOMLA1.5]voirutilisation
title:[NOUVEAUDANSJOOMLA1.5]voirutilisation
syndicate:[NOUVEAUDANSJOOMLA1.5]danslemodlerhuk_milyway,positionutilise
pourafficherlefluxRSS
cp_shell:[NOUVEAUDANSJOOMLA1.5]voirutilisation
Plus15positionsdontlenompeuttrechoisiparleconcepteurdumodle(nomsdepositions
dclarerdansl'administrationdusite:ExtensionGestiondestemplatessousmenuPositionde
module)

ConvertirsontemplateJ!1.0enJ!1.5
Joomla!1.0

Joomla!1.5
TemplateDetails.xml

<mosinstalltype="template">
Contenudefichier
</mosinstall>

<installtype="template">
Contenudefichier
</install>
Index.php

<?phpdefined("_VALID_MOS")or
die("DirectAccesstothislocationisn
$iso=split("=",_ISO);
?>
<!DOCTYPEhtmlPUBLIC"//W3C//DTD
XHTML1.0Transitional//EN""htt
<htmlxmlns="http://www.w3.org/1999/xhtml">
<head>
<?php
if($my>id){initEditor();}
mosShowHead();
?>
<metahttpequiv="ContentType"content="text/
html;<?phpecho_ISO;?>"
<linkhref="<?phpecho$mosConfig_live_site."/
templates/".$mainframe>get
<linkhref="<?phpecho$mosConfig_live_site."/
templates/".$mainframe>get
</head>

<!DOCTYPEhtmlPUBLIC"//W3C//DTD
XHTML1.0Transitional//EN""htt
<htmlxmlns="http://www.w3.org/1999/xhtml"
xml:lang="<?phpecho$this>
<head>
<jdoc:includetype="head"/>
<linkrel="stylesheet"
href="templates/_system/css/general.css"
type="text/
<linkrel="stylesheet"href="templates/<?php
echo$this>template?>/css/te
</head>

_VALID_MOS

_JEXEC

echo'Hello

echoJText::_('Hello')
Laracinedusite(url)

<?phpecho$mosConfig_live_site;?>

<?phpecho$mainframe>getCfg('live_site');?>

$mosConfig_live_site

$this>url
Templatepardfaut

<?phpecho$cur_template;?>

<?phpecho$this>template?>

$mainframe>getTemplate()

$this>template
PathwayFild'ariane

<?phpmosPathWay();?>

<jdoc:includetype="module"
name="breadcrumbs"/>
Date

<?phpechomosCurrentDate();?>

<?phpechoJHTML::Date('now','%d|%m|
%Y');?>

Affichagedecomposant
<?phpmosMainBody();?>

<?phpif($this>params>get('showComponent'))
:?>
<jdoc:includetype="component"/>
<?phpendif;?>
Chargementdesmodules

<?phpif(mosCountModules('top')){?>
<?phpmosLoadModules('top');?>
<?php}?>

<?phpif($this>countModules('top')):?>
<jdoc:includetype="modules"name="top"
style="table"/>
<?phpendif;?>

<?phpmosLoadModules('right',2);?>

<jdoc:includetype="modules"name="right"
style="xhtml"/>
Oprateurs
countModules('user1')
countModules('user1anduser2')
countModules('user1oruser2')
countModules('user1+user2')
1position:
<?php$this>countModules('left');?>
nombredemodules
2positionsET
<?php$this>countModules('leftandright');?>
1silyadesmodules
2positionsOU
<?php$this>countModules('leftorright');?>
1silyadesmodules
2positions+
<?php$this>countModules('left+right);?>
nombredemodules

Stylesd'affichage(pourlesstyles,serfrerlasuitedel'annexe)
Exemple:<?phpmosLoadModules('left',1);?
>
1
2
3

Exemple:<jdoc:includetype="modules"
name="top"style="table"/>
style="table"
style="horz"
style="xhtml"
style="rounded"

Modledebasedufichierindex.php
<?php
/**
*@copyrightCopyright(C)20052007OpenSourceMatters.Allrightsreserved.
*@licenseGNU/GPL,seeLICENSE.php
*Joomla!isfreesoftware.Thisversionmayhavebeenmodifiedpursuant
*totheGNUGeneralPublicLicense,andasdistributeditincludesor
*isderivativeofworkslicensedundertheGNUGeneralPublicLicenseor
*otherfreeoropensourcesoftwarelicenses.
*SeeCOPYRIGHT.phpforcopyrightnoticesanddetails.
*/
defined('_JEXEC')ordie('Restrictedaccess');
?>
<!DOCTYPEhtmlPUBLIC"//W3C//DTDXHTML1.0Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1transitional.dtd">
<htmlxmlns="http://www.w3.org/1999/xhtml"xml:lang="<?phpecho$this>language;?>"
lang="<?phpecho$this>language;?>">
<head>
<jdoc:includetype="head"/>
<!PasdebalisesMETA(utf8,description,author,etc.),nidebaliseTITLE>
<linkrel="stylesheet"href="templates/system/css/system.css"type="text/css"/>
<linkrel="stylesheet"href="templates/system/css/general.css"type="text/css"/>
<!lesdeuxlignescidessussemblentpouvoirtresupprimes(ellesn'existentpasdanslemodle
beez)>
<linkrel="stylesheet"href="templates/<?phpecho$this>template?>/css/template.css"type="text/
css"/>
<!unlinkpourchacunedesfeuillesdestyleutilisesautrecriturepossible,enabsolu:href="<?
phpecho$this>baseurl?>/templates/nom_du_modle/css/...">
<![iflteIE6]><!ventuellement,unefeuilledestylepourIEversion6ouinfrieure>
<linkhref="templates/beez/css/ieonly.css"rel="stylesheet"type="text/css"/>
<![endif]>
<![ifIE7]><!ventuellement,unefeuilledestylepourIEversion7>
<linkhref="templates/beez/css/ie7only.css"rel="stylesheet"type="text/css"/>
<![endif]>
<scripttype="text/javascript"src="templates/<?phpecho$this>template?
>/javascript/mes_fonctions.js"></script>
<!ventuellement,appelunfichiercontenantdesfonctionsJavascript>
</head>
<!FINDEL'ENTETE>
<body>
<!puislesblocsquicontiendrontlesdiffrentespositionsdelafeuillesontindiquesdelafaon
suivante:>
<div>
<jdoc:includetype="modules"name="top"/>
</div>

<!parfois,unattributstyle="..."suitlesattributstype="modules"name="..."etparfoislasuite
unattributheaderLevel="3"parexemple>
<!parfoisapparatuneligne<jdoc:includetype="message"/>:messages(d'erreur)deJoomla>
<jdoc:includetype="component"/><!ICILECONTENUPRINCIPALDESPAGES+
CONTENUDESARTICLES>
<!etenbas,unmodulepourledbogage>
<jdoc:includetype="modules"name="debug"/>
</body>
</html>

Rappel
Contrled'accsaufichierindex.php
Cettelignepeutsavrerindispensablepourdesraisonsdescuritdanslindex.phpdutemplate
lorsquuncheminestutilisdansuntemplateparticulier.
<?phpdefined('_JEXEC')ordie('DirectAccesstothislocationisnotallowed.');?>

DfinitionXHTML
<htmlxmlns="http://www.w3.org/1999/xhtml"xml:lang="<?phpecho$this>language;?>"
lang="<?phpecho$this>language;?>"dir="<?phpecho$this>direction;?>">

Liaisonaveclafeuilledestyle
<linkrel="stylesheet"href="<?phpecho$this>baseurl?>/templates/<?phpecho$this>template?
>/css/template.css"type="text/css"/>
<?phpecho$this>baseurl?>urldebasedusite
<?phpecho$this>template?>nomdutemplate

Appeldel'entte(balisesmeta,title,...)
<jdoc:includetype="head"/>

Contenuprincipal(auparavantMainBodydansJoomla1.0)
<jdoc:includetype="component"/>

Bannire
<jdoc:includetype="module"name="banner"/>(noterque"banner"estausingulier)

Autresmodules
<jdoc:includetype="modules"name="user1"style="1"/>(style:facultatif)

Pieddepage
<jdoc:includetype="module"name="footer"style="1"/>(style:facultatif)

ChemindevisiteouFild'Arianeoupathway
<jdoc:includetype="module"name="breadcrumbs"style="1"/>

Lesstylesdesmodules
Pourlesmodules(ycomprislabannire,lepieddepageoulechemindevisite),unattributstyle
peuttredfinidanslabalise<jdoc...>.S'iln'estpasprsent,ilestgal1pardfaut.
LetableausuivantmontrelecodecritpourJoomla1.5pourunmoduledemenu,avecles
diffrentsstylespossibles:
style=0ou
utilisationdetables,commedans
style="table"
Joomla!1.0
style="1"
(pardfaut)

<ulclass="mainmenu">
<liid="current"class="level1item1
activecurrent">
<ahref="#">lien1</a>
</li>
<liclass="level1item2">
<ahref="#">lien2</a>
</li>
</ul>

Noterlesclassesquipermettent
depersonnaliserlesmenus:
classeactive(liencourant),le
numrod'item,lesclasses
level1,level2,...etl'idcurrent.

style="2"ou
style="xhtml"

<divclass="moduletable_menu">
<h3>MainMenu</h3>
<ulclass="mainmenu">
<liid="current"class="level1
item1activecurrent">
<ahref="#">lien1</a>
</li>
<liclass="level1item2">
<ahref="#">lien2</a>
</li>
</ul>
</div>

Noterletitreh3,etleblocdiv
quienglobeletout,permettant
unemiseenformedumenu.

style="3"ou
style="rounded"

<divclass="module_menu">
<div>
<div>
<div>
<h3>MainMenu</h3>
<ulclass="mainmenu">
<liid="current"class="level1
item1activecurrent">
<ahref="#">lien1</a>
</li>
<liclass="level1item2">
<ahref="#">lien2</a>
</li>
</ul>
</div>
</div>
</div>
</div>

Commelestyle2,maisle
menuestentourparquatrediv
aulieud'unseul.Certains
utilisentcelapourdfinirun
stylechaqueangleetavoirdes
coinsarrondis(voirlemodle
rhuckmilkyway).

StylesCSS
(dfinitionscomplter...)
Extraitdehttp://www.joomlacssguide.com
articleseparatorclass
articleseparatorclassisassignedtotheSPANtagseparatingcontentitemsfromeachother.Thisis
illustratedinthefollowingimage.
back_buttonclass
back_buttonclassisassignedtoaDIVtagdisplayingtheBacklinksinthebottomofcontentitems.

blogclass
blogclassisassignedtoTABLEtagdisplayingcontentitemsformattedasablog.Thisisshownin
thefollowingimage.
blog_moreclass
blog_moreclassisassignedtotheDIVtagcontaininglinkstoothercontentitemsinMore...section
ofjoomlablogpages.Thisisillustratedinthefollowingimage.

blogsectionclass
buttonclass
buttonheadingclass
categoryclass
componentheadingclass
contact_emailclass
content_ratingclass
content_voteclass
contentdescriptionclass
contentheadingclass
contentpagetitleclass
contentpaneclass
contentpaneopenclass
contenttocclass
createdateclass
highlightclass
inputboxclass
latestnewsclass
mainlevelclass
modifydateclass
moduletableclass
mosimageclass
mosimage_captionclass
mostreadclass
pagenavclass
pagenav_prevandpagenav_next
pagenavbarclass
pagenavcounterclass
pathwayclass
pollclass

pollstableborderclass
readonclass
searchclass
searchintro
sectiontableentryclass
sectiontablefooterclass
sectiontableheaderclass
smalldarkclass
sublevelclass
syndicateclass
syndicate_textclass
toclinkclass
wrapperclass
active_menuID
blockrandomID
email_contant_copyID
contact_textID
emailFormID
mod_login_passwordID
mod_login_rememberID
mod_login_usernameID
pollID
search_orderingID
search_searchwordID
searchphraseanyID
searchphraseexactID
VoteidID
searchphraseallID

SourcesetLiens
Sources
http://www.siteground.com/tutorials/joomla15/index.htm
http://dmeziere.free.fr/index.php?op...1&limitstart=0
http://joomla15.nicolasogier.info/doku.php/home
http://www.xtremeopensource.org/inde...ials&Itemid=85
http://www.informit.com/content/imag...35609_CH09.pdf
http://www.joomlacssguide.com/content/view/159/34/
http://forum.joomla.fr/showthread.php?t=67168
http://www.antevox.fr/tlch/creermod...joomla1.5.pdf
http://www.nartconcept.fr/astucesjo...tejoomla.html
http://www.joomladay.fr/index.php?op...egory&catid=10
http://www.joomladraft.org/(pourjoomla!1.0)
http://joomla.cocoate.com/fr/Creatio...emplateJoomla
http://docs.joomla.org/Joomla!_1.5_T...orials_Project

Liens
LiensrelatifsaulangageCSS
http://www.siteduzero.com/tutoriel3...ietescss.html
http://www.w3schools.com/css/(enanglais)
http://wiki.mediabox.fr/documentation/css
http://openweb.eu.org/css
http://www.trucsweb.com/CSS/
http://www.cssfaciles.com/stylesalternatifs.php
http://positioniseverything.net/explorer.html
http://www.chez.com/ilood/

Miseenforme
http://openweb.eu.org/articles/initiation_float
http://www.theasw.com/post/2005/08/...nfloatencss

Menus
http://css.alsacreations.com/Constru...senCSS#float
http://rhunel.developpez.com/tutori...menuvertical/
http://www.cssplay.co.uk/
http://www.wikistuce.info/doku.php/html/emuler_un_float_center_sur_un_menu_horizontal

GnrateuronlinedeCSSetoutilsindispensables
http://css.developpez.com/outils/?pa...e#cssdesigner
http://www.cssdebutant.com/generateurdecss.html
http://www.qrone.org/cssdesigner.html
http://css.developpez.com/outils/?pa...e#cssdesigner
http://css.mammouthland.net/genecss.php

ServicedevalidationCSSduW3C
http://jigsaw.w3.org/cssvalidator/

LiensrelatifsJoomla!
Crationdemodule
http://www.coagul.org/spip.php?article690

Gnrateurdetemplateonline
http://www.joomlatemplatebuilder.com/index.php(enanglais)

Outilspourvousaiderdanslacrationd'untemplate
http://extensions.joomla.org/index.p...1904&Itemid=35
http://antun.vkrgnf.com/(Joomla!1.5TemplateToolbarestunpetitprogrammesansinstallation
pourwindows)
https://addons.mozilla.org/fr/firefox/addon/60(Webdeveloper)
http://www.microsoft.com/downloads/details.aspx?familyid=e59c3964672d4511
bb3e2d5e1db91038&displaylang=en(IEdevelopertoolbar)
http://getfirebug.com/(Firebug)

Vous aimerez peut-être aussi