SlideShare a Scribd company logo
Slimme Joomla! Templating
Tips en Truuks
Robin Poort (@rhcpoort)
JD13NL, Zeist, april 2013
Tweepixels.nl/Academy
trainer | Joomla!
ThemePartner.com
design / development
Templates
index.php
Module alternatieve weergave
Menu item alternatieve weergave
Slimme Joomla! Templating Tips en Truuks
Slimme Joomla! Templating Tips en Truuks
Onveilig
Index.php
Pageclass als body class
<?php
$app = JFactory::getApplication();
$menu = $app->getMenu();
$active = $menu->getActive();
$pageclass = '';
if(is_object($active)
&& isset($active->params)
&& $active->params instanceof JRegistry) {
$pageclass = $active->params->get('pageclass_sfx', '');
}
?>
<body class="<?php echo !empty($pageclass) ? $pageclass : ''; ?>">
...
</body>
body.home {
font-size: 120%;
}
div.left-column {
width: 20%;
}
body.home div.left-column {
width: 40%;
}
Slimme Joomla! Templating Tips en Truuks
<field name="templateStyle"
type="list"
default="style1"
label="Template Style"
description="Kies een stijl voor je template">
<option value="style1">Style1</option>
<option value="style2">Style2</option>
</field>
<?php
$params = JFactory::getApplication()->getTemplate(true)->params;
?>
<body class="<?php echo $params->get('templateStyle'); ?>">
body.style1 { ... }
body.style2 h3 { ... }
<body class="mediumFont highlightFirstWords">
...
</body>
body.smallFont {
font-size: .875em;
}
body.mediumFont {
font-size: 1em;
}
body.largeFont {
font-size: 1.25em;
}
$('body.highlightFirstWords h3').each(function() {
...
});
body {
z-index: 0;
}
@media (min-width:600px) {
body {
z-index: 1;
}
}
if ($('body').css('z-index') == '0') {
...
}
if ($('body').css('z-index') == '1') {
...
}
Alternatieve
weergaven
Modules
Componenten Categorieën
M
enu
item
s
Multi
level
Meer info: http://docs.joomla.org/Layout_Overrides_in_Joomla_2.5
Joomla! installation
components
com_content
views
article
tmpl
default.php
Joomla! installation
templates
[Your template]
html
com_content
article
default.php
views
tmpl
Module Alternatieve Weergave
Website name
Home Item1 Item2 Item3 Contact
Proin sit amet justo interdum
nulla commodo dignissim.
Proin consequat neque vestibulum odio tristique sollicitudin. Ut
molestie ligula ipsum. Suspendisse feugiat quam ut elit mattis
laoreet. Praesent non mi tortor, cursus egestas odio. Aliquam
leo tellus, tincidunt vel pulvinar ac, facilisis eget odio.
Readmore
Slimme Joomla! Templating Tips en Truuks
Joomla! installation
modules
mod_articles_category
tmpl
default.php
Joomla! installation
templates
[Your template]
html
mod_articles_category
default.php
Joomla! installation
templates
[Your template]
html
mod_articles_category
articleslider.php
<?php
$doc =& JFactory::getDocument();
$doc->addScript('...');
$doc->addStylesheet('...');
?>
<div class="articleslider">
...
<?php foreach ($list as [list or group]) : ?>
<li class="slider-item">
...
<p>
<?php $images = json_decode($item->images); ?>
<img src="<?php echo htmlspecialchars($images->image_intro); ?>">
</p>
...
</li>
<?php endforeach; ?>
...
</div>
Slimme Joomla! Templating Tips en Truuks
Slimme Joomla! Templating Tips en Truuks
Website name
Home Item1 Item2 Item3 Contact
Proin sit amet justo interdum
nulla commodo dignissim.
Proin consequat neque vestibulum odio tristique sollicitudin. Ut
molestie ligula ipsum. Suspendisse feugiat quam ut elit mattis
laoreet. Praesent non mi tortor, cursus egestas odio. Aliquam
leo tellus, tincidunt vel pulvinar ac, facilisis eget odio.
Readmore
Menu Item Alternatieve Weergave
Slimme Joomla! Templating Tips en Truuks
Slimme Joomla! Templating Tips en Truuks
Slimme Joomla! Templating Tips en Truuks
dl.contact-address dt {
display: none;
}
dl.contact-address dd {
margin-left: 0;
}
.contact-form legend {
font-size: 1em;
margin-bottom: 0;
}
.contact-form fieldset .control-group:nth-child(6) {
display: none;
}
#jform_contact_message {
width:60%;
height:150px;
}
Slimme Joomla! Templating Tips en Truuks
Joomla! installation
components
com_contact
views
contact
tmpl
default.php
Joomla! installation
templates
[Your template]
html
com_contact
userfriendly.php
contact
Joomla! installation
components
com_contact
views
contact
tmpl
default.xml
Joomla! installation
templates
[Your template]
html
com_contact
userfriendly.xml
contact
<layout title="COM_CONTACT_CONTACT_VIEW_DEFAULT_TITLE"
option="COM_CONTACT_CONTACT_VIEW_DEFAULT_OPTION">
<help key = "JHELP_MENUS_MENU_ITEM_CONTACT_SINGLE_CONTACT" />
<message>
<![CDATA[COM_CONTACT_CONTACT_VIEW_DEFAULT_DESC]]>
</message>
</layout>
<layout title="User Friendly Contact Form"
option="COM_CONTACT_CONTACT_VIEW_DEFAULT_OPTION">
<help key = "JHELP_MENUS_MENU_ITEM_CONTACT_SINGLE_CONTACT" />
<message>
Create a user friendly contact form
</message>
</layout>
Slimme Joomla! Templating Tips en Truuks
...
<div class="span4">
<div class="well">
[contact info area] ...
</div>
<div class="well">
<p>You can use this form in case you:</p>
...
</div>
</div>
<div class="span8">
[contact form area] ...
<h3>Privacy policy</h3>
...
</div>
...
Slimme Joomla! Templating Tips en Truuks
Joomla! installation
components
com_contact
views
contact
tmpl
default_address.php
Joomla! installation
templates
[Your template]
html
com_contact
userfriendly_address.php
contact
Joomla! installation
components
com_contact
views
contact
tmpl
default_form.php
Joomla! installation
templates
[Your template]
html
com_contact
userfriendly_form.php
contact
Slimme Joomla! Templating Tips en Truuks
Slimme Joomla! Templating Tips en Truuks
Vragen?
Ga eens met overrides spelen en oefenen
Probeer meer uit de core te halen
Laat de core met rust! (geen core-hacks)
Laat extensies niet altijd links liggen
Gebruik in je volgende website eens
maximaal 2 frontend extensies
@rhcpoort | @theme_partner | @tweepixels
www.themepartner.com | www.tweepixels.nl/academy
Time's up
Copyright image on first slide:
http://upload.wikimedia.org/wikipedia/commons/3/32/Terry_Evanswood.jpg

More Related Content

PPT
Clever Joomla! Templating Tips and Tricks
PDF
FamilySearch Reference Client
KEY
Keeping It Simple
PPTX
Web development today
PPTX
17. CodeIgniter login simplu cu sesiuni
KEY
Who Needs Ruby When You've Got CodeIgniter
PDF
Count to 10 and Say Yes
PPT
WordPress as a Content Management System
Clever Joomla! Templating Tips and Tricks
FamilySearch Reference Client
Keeping It Simple
Web development today
17. CodeIgniter login simplu cu sesiuni
Who Needs Ruby When You've Got CodeIgniter
Count to 10 and Say Yes
WordPress as a Content Management System

What's hot (20)

PDF
Laravel 로 배우는 서버사이드 #5
PDF
Building scalable products with WordPress - WordCamp London 2018
PDF
Curso Symfony - Clase 3
PDF
Owasp & php
PDF
Engines: Team Development on Rails (2005)
DOCX
PDF
Understanding form helpers
PDF
Gravity Forms Hooks & Filters
PPTX
Security in laravel
PDF
fb-researchの舞台裏No.2~技術編~(HatchUp主催 渋谷Facebookアプリ勉強会)
PDF
Django の認証処理実装パターン / Django Authentication Patterns
PPTX
WordPress overloading Gravityforms using hooks, filters and extending classes
TXT
https://www.facebook.com/valdyna.monna?fref=ts
PDF
Curso Symfony - Clase 2
TXT
Send.php
PDF
7 reasons why developers should love Joomla!
PDF
Curso Symfony - Clase 4
PDF
Drupal8 simplepage v2
PDF
Action View Form Helpers - 1, Season 2
PPTX
10 useful WordPress functions (and maybe more)
Laravel 로 배우는 서버사이드 #5
Building scalable products with WordPress - WordCamp London 2018
Curso Symfony - Clase 3
Owasp & php
Engines: Team Development on Rails (2005)
Understanding form helpers
Gravity Forms Hooks & Filters
Security in laravel
fb-researchの舞台裏No.2~技術編~(HatchUp主催 渋谷Facebookアプリ勉強会)
Django の認証処理実装パターン / Django Authentication Patterns
WordPress overloading Gravityforms using hooks, filters and extending classes
https://www.facebook.com/valdyna.monna?fref=ts
Curso Symfony - Clase 2
Send.php
7 reasons why developers should love Joomla!
Curso Symfony - Clase 4
Drupal8 simplepage v2
Action View Form Helpers - 1, Season 2
10 useful WordPress functions (and maybe more)
Ad

Viewers also liked (6)

PPT
Joomla! SEO (with Super Mario) [Dutch]
PPTX
Van voor, naar achter, van links naar... Likes?
PPTX
Is Joomla nog steeds de juiste keuze in 2017?
PPT
Creating User Friendly Joomla! Websites and Forms [English]
PPTX
Stop Building Links, Start Earning Them
PPT
Responsive Design: Uitdagingen en Oplossingen
Joomla! SEO (with Super Mario) [Dutch]
Van voor, naar achter, van links naar... Likes?
Is Joomla nog steeds de juiste keuze in 2017?
Creating User Friendly Joomla! Websites and Forms [English]
Stop Building Links, Start Earning Them
Responsive Design: Uitdagingen en Oplossingen
Ad

Similar to Slimme Joomla! Templating Tips en Truuks (20)

PDF
Your Custom WordPress Admin Pages Suck
PPT
07 Php Mysql Update Delete
PDF
Django Vs Rails
PPT
JS-05-Handlebars.ppt
PDF
Implement rich snippets in your webshop
PDF
You're Doing it Wrong - WordCamp Orlando
PDF
Grok Drupal (7) Theming
PDF
Ditching JQuery
PDF
The Rails Way
PDF
Practical PHP by example Jan Leth-Kjaer
PDF
HTML5 and the dawn of rich mobile web applications pt 2
PPTX
Jquery tutorial
PDF
Bag Of Tricks From Iusethis
TXT
Fcr 2
PDF
Ajax nested form and ajax upload in rails
PPSX
WordPress Theme Design and Development Workshop - Day 3
DOCX
Kohana bootstrap - modal form
PDF
Kohana bootstrap - modal form
PDF
How to Create A Magento Adminhtml Controller in Magento Extension
KEY
PHPConf-TW 2012 # Twig
Your Custom WordPress Admin Pages Suck
07 Php Mysql Update Delete
Django Vs Rails
JS-05-Handlebars.ppt
Implement rich snippets in your webshop
You're Doing it Wrong - WordCamp Orlando
Grok Drupal (7) Theming
Ditching JQuery
The Rails Way
Practical PHP by example Jan Leth-Kjaer
HTML5 and the dawn of rich mobile web applications pt 2
Jquery tutorial
Bag Of Tricks From Iusethis
Fcr 2
Ajax nested form and ajax upload in rails
WordPress Theme Design and Development Workshop - Day 3
Kohana bootstrap - modal form
Kohana bootstrap - modal form
How to Create A Magento Adminhtml Controller in Magento Extension
PHPConf-TW 2012 # Twig

More from ThemePartner (8)

PPT
Creating User Friendly Joomla! Websites and Forms | Joomla! Day Deutschland
PPT
Learn to love CSS3 | Joomla! Day Deutschland
PPT
Learn to Love CSS3 [English]
PPT
Joomla! SEO (With Super Mario) [English]
PPT
6 Psychological Techniques to Improve Your Conversion Rate [English]
PPT
Gebruiksvriendelijke sites maken (dutch)
PPT
CSS3 (dutch)
PPT
Joomla 2.5 SEO [Dutch]
Creating User Friendly Joomla! Websites and Forms | Joomla! Day Deutschland
Learn to love CSS3 | Joomla! Day Deutschland
Learn to Love CSS3 [English]
Joomla! SEO (With Super Mario) [English]
6 Psychological Techniques to Improve Your Conversion Rate [English]
Gebruiksvriendelijke sites maken (dutch)
CSS3 (dutch)
Joomla 2.5 SEO [Dutch]

Recently uploaded (20)

PDF
Encapsulation theory and applications.pdf
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PPTX
MYSQL Presentation for SQL database connectivity
PPTX
A Presentation on Artificial Intelligence
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Approach and Philosophy of On baking technology
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
cuic standard and advanced reporting.pdf
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
NewMind AI Monthly Chronicles - July 2025
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
Encapsulation theory and applications.pdf
Spectral efficient network and resource selection model in 5G networks
Building Integrated photovoltaic BIPV_UPV.pdf
MYSQL Presentation for SQL database connectivity
A Presentation on Artificial Intelligence
Unlocking AI with Model Context Protocol (MCP)
Approach and Philosophy of On baking technology
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
cuic standard and advanced reporting.pdf
Encapsulation_ Review paper, used for researhc scholars
NewMind AI Monthly Chronicles - July 2025
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
“AI and Expert System Decision Support & Business Intelligence Systems”
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Diabetes mellitus diagnosis method based random forest with bat algorithm

Slimme Joomla! Templating Tips en Truuks

Editor's Notes

  • #3: Vertellen wie ik ben en wat ik doe
  • #4: Wat kan je allemaal met templates? Truuks voor in index.php. En alternatieve weergaven
  • #5: In de template gebeurd alles qua vormgeving en ook een stukje techniek. Tegenwoordig kan je heel erg veel! Vandaag leren dat ook dingen waarvan je het niet verwacht. Simpel gezegd, je hoeft niet altijd meteen naar de &quot;JED&quot; te rennen.
  • #6: Waarom? Een stukje gemak. Sommigen weten niet beter, daar ga ik vandaag verandering in brengen! En waarom zou ik dat doen? Nou 1 van de redenen dat je minder extensies zou moeten gebruiken is om het volgende:
  • #7: Kan onveilig zijn. TMP map. Xmap bug + kan ook zonder extensie. Vaak zijn extensies te groot. Te veel opties terwijl je maar 1 keer de extensie nodig hebt.
  • #8: Zonder index.php geen template. Wat kan je er mee? Ik zal een aantal handige om eenvoudiger te stylen.
  • #9: Column breder homepage. Fonts groter. Kleuren anders. Andere vormgeving. Op sommige pagina&apos;s. Hoe werkt dat? Je hebt je menu-items, in advanced staat onder page display de page class optie. Vul die in en je bent klaar! Alleen ben je er dan nog niet. Joomla! laat hem zien in het component (op verschillende plekken). Maar het zou handig zijn als ie op de body zat. Doe het volgende..
  • #10: In je index.php zet je bovenstaande code bovenaan boven de &lt;html&gt; Vervolgens zet je dat onderstaande stukje in je body
  • #11: Vervolgens kun je dit in je css zetten. Even uitleggen...
  • #12: Dat was voor 1 website op 1 domein. Wat je ook kunt doen is dezelfde template voor 2 websites gebruiken. Bijvoorbeeld 4 webshops die je hebt. Allemaal in dezelfde layout met dezelfde code maar dan met een andere kleur. Als je dan ook dezelfde index.php gebruikt dan is het handig om een optie te maken in de backend (zo gedaan) om vervolgens een class aan iedere pagina te hangen.
  • #13: De code is als volgt...
  • #14: Meer classes. Ook JS aanspreken. Responsive? JS via Media Queries.
  • #15: Uitleg... Ok so much for the index.php. Nu het echte werk en hoppa naar alternatieve weergaven
  • #16: Alternatieve weergaven zijn overrides maar dan anders. Je hebt alternatieve weergaven in de volgende categorieen:
  • #17: Gebruiken kan in begin verwarrend overkomen. Soms wel beschikbaar anders niet. Soms worden wwergaven wat anders op een andere plek. Eerst gewone overrides bespreken.
  • #18: Dit is je structuur. Je hebt je installatie met de volgende mappen er in
  • #19: Zo kun je een override maken. Mappen views en tmpl kun je weglaten. Joomla gebruikt nu de bestanden die in je template map staan.
  • #20: We beginnen maar even makkelijk! Met de module alternative weergave.
  • #21: Stel je voor: Je wil het volgende gaan maken... Het is een slider waarin wat info staat en een afbeelding met nog een titel en een readmore. Wat gaan we dan doen?
  • #22: Vandaag met module. Titel + tekst + readmore + intro-image. Pakken we newsflash of bijv. articles category &gt; meer opties
  • #23: We beginnen met het opzoeken van het bestand wat we nodig hebben. In je installatie naar modules category en dan tmpl en je bestand pakken. Deze kopieren.
  • #24: HTML map aanmaken.
  • #25: Alternatieve weergave? Geef hem een andere naam
  • #26: Scripts + stylesheets toevoegen aan alleen die pagina&apos;s. Bijv. flexslider voor animaten.
  • #27: HTML moet JS snappen dus classes. Nog geen intro images in modules. Dus zelf ophalen want wel beschikbaar. Op de puntjes staat meer code.
  • #28: Kies voor een category of featured en hoeveel je er wil tonen
  • #29: En kies vervolgens bij Advanced options je nieuwe layout &quot;articleslider&quot;.
  • #30: Stel je voor: Je wil het volgende gaan maken... Het is een slider waarin wat info staat en een afbeelding met nog een titel en een readmore. Wat gaan we dan doen?
  • #31: Iets moeilijker. Eigenlijk nieuwe menu items. Contactformulier gebruikersvriendelijk. Aanmaken in Joomla en kijken.
  • #32: Formulier niet zichtbaar en best lelijke opmaak. Niet opgeven en instellingen aanpassen.
  • #33: Beter maar niet goed. Legend te groot. Message veld klein. Adresgegevens raar ingesprongen. Wat doen we?
  • #34: Naar de JED! RSForms. Chronoforms. Contactform. Veel functionaliteit. Veel scripts e.d.. Dit allemaal nodig?
  • #35: Css. verbergen, groter maken, margins etc.
  • #36: Al beter. Adresgegevens naast formulier. Privacy policy en intro is makkelijk.
  • #37: Zoek het bestand op
  • #38: Kopieer en vernoem. Geen underscores.
  • #39: Maar ook xml pakken voor menu item.
  • #40: Kopieer en vernoem.
  • #41: Even alleen titel aanpassen. Uiteraard in taalbestanden. Meer aanpassen? Geen probleem, niet voor presentatie.
  • #42: Verander menu item type in bestaand contact. Daar staat ie.
  • #43: De .php aanpassen. Bootstrap (protostar) classes toevoegen. Op puntjes staat weer meer code.Naast elkaar met span. Contact in mooie well. Info er onder en privacy policy.
  • #44: Adres tel + fax indicatie. All fields required. Labels links.Meer bestanden kopieeren uit de bron map. Niet gekopieerd? dan gebruikt joomla de standaard.
  • #45: Wel underscores net als origineel
  • #46: Zelfde prefix underscore
  • #47: Wel underscores net als origineel
  • #48: Zelfde prefix underscore
  • #49: Uiteindelijk zou dit bijvoorbeeld je contact form kunnen zijn
  • #50: En dat is toch al een stuk beter dan deze dahct ik zo!
  • #54: ...