Home Web-development Joomla! 1.5 Template Design

Joomla! 1.5 Template Design

By Tessa Blakeley Silver
books-svg-icon Book
Subscription
$10 p/m for first 3 months. $15.99 p/m after that. Cancel Anytime!
What do you get with a Packt Subscription?
This book & 7000+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with a Packt Subscription?
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with eBook + Subscription?
Download this book in EPUB and PDF formats, plus a monthly download credit
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with a Packt Subscription?
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with eBook?
Download this book in EPUB and PDF formats
Access this title in our online reader
DRM FREE - Read whenever, wherever and however you want
Online reader with customised display settings for better reading experience
What do you get with video?
Download this video in MP4 format
Access this title in our online reader
DRM FREE - Watch whenever, wherever and however you want
Online reader with customised display settings for better learning experience
What do you get with video?
Stream this video
Access this title in our online reader
DRM FREE - Watch whenever, wherever and however you want
Online reader with customised display settings for better learning experience
What do you get with Audiobook?
Download a zip folder consisting of audio files (in MP3 Format) along with supplementary PDF
What do you get with Exam Trainer?
Flashcards, Mock exams, Exam Tips, Practice Questions
Access these resources with our interactive certification platform
Mobile compatible-Practice whenever, wherever, however you want
BUY NOW $10 p/m for first 3 months. $15.99 p/m after that. Cancel Anytime!
Subscription
What do you get with a Packt Subscription?
This book & 7000+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with a Packt Subscription?
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with eBook + Subscription?
Download this book in EPUB and PDF formats, plus a monthly download credit
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with a Packt Subscription?
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with eBook?
Download this book in EPUB and PDF formats
Access this title in our online reader
DRM FREE - Read whenever, wherever and however you want
Online reader with customised display settings for better reading experience
What do you get with video?
Download this video in MP4 format
Access this title in our online reader
DRM FREE - Watch whenever, wherever and however you want
Online reader with customised display settings for better learning experience
What do you get with video?
Stream this video
Access this title in our online reader
DRM FREE - Watch whenever, wherever and however you want
Online reader with customised display settings for better learning experience
What do you get with Audiobook?
Download a zip folder consisting of audio files (in MP3 Format) along with supplementary PDF
What do you get with Exam Trainer?
Flashcards, Mock exams, Exam Tips, Practice Questions
Access these resources with our interactive certification platform
Mobile compatible-Practice whenever, wherever, however you want
  1. Free Chapter
    Getting Started as a Joomla! Template Designer
About this book

Using Joomla! Templates with HTML and CSS allows you to give a unique look and feel to your site, present a "fresh face" to your pre-existing content, ensure that your site design is consistent with your brand, and build a site layout that suits your unique needs. A quality web site is easily within your grasp using these cutting-edge templates. However, even experienced web developers need help to take their designs and turn them into flexible and easily maintainable Joomla! 1.5 templates.

The release of Joomla! 1.5 meant a radically enhanced template system that is very different from that of Joomla! 1.0. Joomla! 1.5 comes complete with the ability to create template overrides and customize "module chrome". The Joomla! development team has also revamped the template process by introducing clean, understandable jdoc tags in place of the PHP function-based Mambo-derived markup that Joomla! 1.0 templates used. This book focuses squarely on the new enhancements to the Joomla! 1.5 templating process and walks web designers through the process of turning a working XHTML and CSS "mockup" into a fully functional Joomla! 1.5 template.

This well-crafted and easy-to-use book provides you with everything you need to create your own unique Joomla! 1.5 template. It guides you through setting up a basic work flow for Joomla! template design, debugging and validating the template code, creating drop-down menus and dynamic forms for your site, and packaging up your finished template in a ZIP file for users. At the end of this book you will be able to create a template that is effective, flexible, and presents a new look for the pre-existing content.

This book focuses on the new jdoc template system for Joomla! 1.5. It is geared toward web designers who need to know how to turn their designs into Joomla! 1.5 templates. It covers how to enhance and speed up your design and revision process, then focuses squarely on the Joomla! 1.5 essentials of creating a template. It covers implementing template overrides, the best approaches for implementing Flash and AJAX techniques, as well as advanced enhancements such as creating design parameters so users can have some control over the template via the administration panel. The original 1.0 book covered how to amend an existing 1.0 template before creating one from scratch, the new templating features of Joomla! 1.5 are so logical to implement we move right into creating a full table-less, semantic XHTML/CSS template from scratch.

Publication date:
June 2009
Publisher
Packt
Pages
284
ISBN
9781847197160

 

Chapter 1. Getting Started as a Joomla! Template Designer

Welcome to Joomla! 1.5 template design. This title is intended to take you through the intricate details of creating sophisticated professional templates for Joomla! 1.5's CMS. In the summer of 2007, I wrote a book for creating Joomla! 1.0 templates. You wouldn't think that much has changed since then, but it has.

With Joomla's official stable release of 1.5 comes a completely reworked and greatly improved administration panel and all new template construction methods. In addition to Joomla's enhancements, the release of IE8 has brought CSS2.1 and a bit more CSS3 support for all major browsers. This means between Joomla's improvements and advances in web standards, the approach and techniques we can use to create our templates is remarkably different from just two years ago. While we all will still need to support IE6 and IE7 for some time further, where applicable, I'll discuss the use of some CSS3 techniques and any graceful degrading methods they might have (just a few samples—this is a book about Joomla! templates, not just CSS, after all).

In these up coming chapters, we'll walk through all the necessary steps required to aid, enhance, and speed up your Joomla! template design process. From design tips and suggestions to packaging up the final template, we'll review best practices for the following range of topics: designing a great template, rapid template development, coding markup, testing, debugging, and taking it live.

The last three chapters are dedicated to additional tips, tricks, and various cookbook recipes for adding popular site enhancements to your Joomla! template designs by using third-party extensions, as well as creating your own solutions.

 

Joomla! 1.5 perks


Since you're interested in generating custom templates for Joomla! 1.5, you'll be very happy to know (especially, all you "web standards evangelists") that Joomla! does separate content from design, as has always been the case. What's new is our control as template developers over what Joomla! outputs from its "core" (or, how it displays our CMS content).

A few of Joomla! 1.5's newest and most important template features include:

  • The removal of bulky PHP-wrapped mosLoadModule tags in place of more XHTML-markup-friendly jdoc tags (which are similar to XHTML, but are part of Joomla's template system). Jdoc tags give you much cleaner template code (and much less syntax to accidentally mess up). If you're not a PHP developer, you can now develop a template with essentially no PHP code (though, as we'll discover, some PHP is still used and quite helpful in enhancing a template).

  • Template positions are easily defined and handled through your template's jdoc tags and templateDetails.xml file. No need to use predefined module position names or worry that your template user must set up special positions in the administration panel.

  • Full, easy to implement control over what's known as module chrome (that is, how your modules are wrapped in XHTML). You can just simply assign one of the built-in style selectors to your jdoc tags, or if you've got a handle on PHP, you can create your own custom module chrome and implement it through jdoc tags. (We'll touch on that advanced technique in Chapter 9)

  • The introduction of template overrides, which allow you to bypass Joomla's table-heavy core output in favor of table-less output. Joomla! provides us with a great set of accessible, table-less overrides in the Beez template, which we'll work with in Chapter 3. However, if you're an XHTML and PHP wiz, you can create any custom output you can dream of, which we'll cover the basics of in Chapter 9.

  • There's also an exciting addition of template parameters. Joomla! lets you set up params.ini file and construct your template in such a way that users can change settings from within the administration interface. This is a great perk to add to your templates that your users will appreciate.

  • Of course, there are more new features than the above, and I'll be pointing them out as we come across them in the following chapters of the book.

 

Pick a template or design your own?


My approach to template design can be from one of two angles: The first is Simplicity, and the second is Unique and Beautiful.

  • For the Simplicity route, sometimes it suites the client and/or the site to go as bare bones as possible. If that is the case, it's just quick and easy to take a very basic pre-made template and modify it. This does not have to be a Joomla! 1.5 template! This book will teach you how to take any basic XHTML/CSS markup that you understand and turn it into a working Joomla! 1.5 template.

  • Occasionally, you'll need to take the Unique and Beautiful route and create the site's template from scratch, so that everything displayed caters to the specific kind of content the site offers. This ensures the site is something eye-catching and completely unique. This is often the best route when custom branding is a priority, or when you just want to show off your "Hey, I'm hot stuff" design skills.

There are many benefits to using or tweaking pre-made templates, some of which are:

  • You can potentially save a lot of time getting your site up with a nice template design

  • You don't need to know as much about CSS, XHTML, or PHP

This means, with a little web surfing, you can have your Joomla! site up and running with a stylish look in no time.

Drawbacks to using a pre-made template

A drawback to using a pre-made template is that whether it's another Joomla! template or just a static XHTML/CSS template, it may not save you as much time as hoped for. Even with your new header text and graphic, several other sites have downloaded and/or purchased them for themselves, and you don't stand enough apart.

Perhaps your Joomla! site needs a special third-party extension for a specific type of content; it might not look quite right in your template without a lot of tweaking. Moreover, while we're discussing tweaking, I find every CSS designer is different and sets up his/her design's layout and stylesheet accordingly. While it makes perfect sense to them, it can be confusing and time-consuming to work through.

Your approach may have started out as Simplicity, but then, for one reason or another, you find yourself having to dig deeper and deeper through the template, and pretty soon it doesn't feel like quick tweaking anymore. Sometimes you realize, for simplicity's sake (no pun intended), it would have been a whole lot quicker to start from scratch.

Before trying to cut corners with a pre-existing template, make sure your project really is as simple as it claims to be. Once you find a template, check that you are allowed to tweak and customize it (such as an open source GNU/GPL or Creative Commons license or royalty free purchase from a template site) and that you have a look at the stylesheet and template files. Make sure the template's assets seem logical and make sense to you.

This book's approach

The approach of this book is going to take you through the Unique and Beautiful route with the idea that once you know how to create a template from scratch, you'll be able to understand what to look for in other people's XHTML/CSS markup and/or Joomla! templates. You'll then be able to assess when it is really better or easier to use a pre-made template versus building up something of your own from scratch.

Note

Updating 1.0 templates? If you're looking to update a legacy Joomla! 1.0 template to a native Joomla! 1.5 template, you'll find reading through this book's overall process helpful before sitting down with Chapter 6's Reference Guide, which details how to update major 1.0 template code to 1.5 template code.

 

Things you'll need to know


This book is geared toward visual designers with no server-side scripting or programming experience who are used to working with common industry standard tools, such as Photoshop and Dreamweaver, or other popular graphic, HTML, and text editors.

Regardless of your web development skill set or level, you'll be walked through clear, step-by-step instructions, although there are many web development skills and much Joomla! know-how you'll need to be familiar with to gain maximum benefit from this book.

Joomla! 1.5

Most importantly, you should be familiar with the most current, stable version of Joomla! 1.5. This includes a general understanding of the Administrative Panel's layout and basic functions.

Note

What version of Joomla! 1.5 does this book use? While this book's case study was developed using versions 1.5.7, 1.5.8, and 1.5.9, any newer version of Joomla! 1.5 should have the same core capabilities, enabling you to develop templates for it using these techniques. Bug fixes and new features for each new version of Joomla! are documented at http://docs.joomla.org/Special:RecentChanges.

You should understand how to add content to the Joomla! CMS and how its modules and components work. Understanding the basics of installing and using module and component extensions will also be helpful (though we will cover that to some extent in the later chapters of the book as well). Chapter 3 will give you some great resources for installing your Joomla! 1.5 development sandbox.

Even if you'll be working with a more technical Joomla! administrator, you should have an overview of what the Joomla! site you're designing for entails and what, if any, additional extensions will be needed for the project. If your site does require additional extensions, you'll want to have them handy and/or installed in your Joomla! development installation (your sandbox—a place to test and play without messing up a live site). This will ensure that your design will cover all the various types of content the site intends to provide.

Note

First time with Joomla!? I recommend you read"Building Websites With Joomla! 1.5", Hagen Graf, Packt Publishing.

CSS

I'll be giving detailed explanations of most of the CSS rules and properties used in this book, along with the "how and why" behind those decisions. I won't cover every minor detail of the more basic CSS styles and rules, as, after all, this is not a book about CSS or general web development. We'll be focusing more on what you need to know about Joomla! 1.5 in terms of templating.

You should know a bit about what CSS is and the basics of setting up a cascading style sheet and including it as an external file within an XHTML page. CSS is an essential part of today's web development process. You'll find that the more comfortable you are with CSS markup and how to use it effectively with XHTML, the better your experience creating a Joomla! template will be. Where applicable, I'll point you towards some great resources for better understanding CSS techniques and adding to personal tricks and code arsenal.

XHTML

You don't need to have every markup tag in the XHTML standard memorized (yes, if you really want to, you can still switch to the Design view in your HTML editor to drop in those markup tags you keep forgetting—I won't tell). However, the more XHTML basics you understand, the more comfortable you'll be working with the markup in the Code view of your HTML editor or with a plain text editor. And, the more you can work directly with the markup, the quicker you'll be able to create well-built templates that are quick loading, semantic, expand easily to accommodate new features, and are search engine friendly.

PHP

You definitely don't have to be a PHP programmer to get through this book. Joomla! 1.5 has gone through great pains to ensure PHP is not needed in your base template. However, be aware that Joomla! does run on PHP and certain template enhancements are still made using PHP code.

If you at least understand how basic PHP syntax is structured, you'll be much less likely to make mistakes while re-typing or copy-pasting code snippets of PHP into your index.php file. You'll be able to more easily recognize the difference between your template's XHTML markup and PHP code, so that you don't accidentally delete or overwrite anything crucial.

If you get more comfortable with PHP, you'll have the ability to change out variables and call new functions, template overrides, and module chrome on your own. In later chapters, we'll touch on getting you started with those endeavors.

Tip

Beef up those web skills

I'm a big fan of the W3Schools site. If you'd like to build up your XHTML, CSS, and PHP understanding, this site walks you through everything, from basic introductions to robust uses of top web languages and technologies. All the lessons are easy, comprehensive, and free (http://w3schools.com).

Not necessary, but helpful

If your project will be incorporating any other special technologies such as JavaScripting, AJAX, or Flash content, the more you know and understand how those scripting languages and technologies work, the better it is for your template-making experience (again W3Schools.com is a great place to start).

Tip

The more web technologies you have a general understanding of, the more likely it is to intuitively make a more flexible template that will be able to handle anything the site's administrators and authors may want to incorporate in the future.

 

Tools of the trade


In order to get started in the next chapter, you'll need the following tools to help you out.

HTML editor

You'll need a good HTML editor. Dreamweaver is good (http://www.adobe.com/products/dreamweaver/ ); I prefer to use Coda for Mac (http://www.adobe.com/products/dreamweaver/ ). When I was on a PC, I loved the free text/code editor HTML-kit (http://www.htmlkit.com/ ). Any HTML or text editor that lets you enable the following features will work just great. (I recommend you enable all of the following):

  • View line numbers: This comes in very handy during the validation and debugging process. It can help you find specific lines in a template file that a validation tool has returned a fix for. This is also helpful for other template or extension instructions given by author, which refer to a specific line of code that needs editing.

  • View syntax colors: Any worth while HTML editor has this feature, which is usually set as a default. The good editors let you choose your own colors. It displays code and other markup in a variety of colors, making it easier to distinguish various types of syntax. Many editors also help you identify "broken" XHTML markup, CSS styles, or PHP code.

  • View non-printing characters: OK, you might not want this feature on all the time. It makes it possible to see hard returns, spaces, tabs, and other special characters that you may or may not want in your markup and code.

  • Text wrapping: This, of course, lets text within the window, so you won't have to scroll horizontally to edit a long line of code. It's best to learn what the key-command shortcut is for this feature in your editor and/or set up a key-command shortcut for it. You'll find it easier to scroll through unwrapped, nicely-indented markup to quickly get a general overview or find your last stopping point. Turn it on quickly so in order to see and focus attention on one long line of markup or code.

Note

Open source HTML editors: I've also used Nvu (http://www.net2.com/nvu/ ) and Kompozer (http://kompozer.net/ ). They're both free, open source, and available for Mac, PC, and Linux platforms. Kompozer was made from the same source as Nvu and apparently fixes some issues that Nvu has. (I haven't run into any major issue with Nvu myself—both editors are a bit limited for my regular use, although I do like being able to format XHTML text quickly and drag-and-drop form objects onto a page.) Both editors have a Source view, but you must be careful while switching between the Normal and the Source view tabs! Nvu and Kompozer are a little too helpful, and will try to rewrite your hand-coded markup if you haven't set your preferences properly! Linux users of Ubuntu and Debian (and Mac users with Fink) might also be interested in checking out Bluefish editor. I haven't used it myself, but the site's writeup looks great: http://bluefish.openoffice.nl.

Graphic editor

The next important piece of software you'll need is a graphic editor. While you can find plenty of CSS-only Joomla! templates out there, chances are, you'll want to expand on your design a little more and add nice visual enhancements. These are best achieved by using a graphic editor such as GIMP, Photoshop, or Fireworks. Adobe owns both Photoshop and Fireworks and also offers a light and less-expensive version of Photoshop called Photoshop Elements, which will allow you to do everything discuss in this book (http://www.adobe.com/products/ ).

While I'm an advocate of open source and enjoy working with GIMP, in my line of work, the industry standard is Photoshop or Fireworks. I'll be using Adobe Photoshop in this title and assume that you have some familiarity with it, or GIMP, and with working with layers. Any graphic editor you prefer is fine. One that allows you to work with layers is very helpful, especially with the design comping (aka mockup) techniques suggest in Chapter 2.

Note

Need a great graphic editor? Try GIMP. If you're on a budget and in need of a good image editor, I recommend you use GIMP. It is available for PC, Mac, and Linux. Get it from http://gimp.org/.

Prefer vector art? Try Inkscape. Inkscape is also available for PC, Mac, and Linux. Bitmap graphic editors are great in that they also let you enhance and edit photographs, but if you just want to create buttons or other interface elements and vector-based illustrations, Inkscape is great, has a low learning curve, and is worth trying out (http://inkscape.org ).

Firefox

Last, you'll need a web browser. Here, I'm not so flexible. I strongly suggest you use the latest, stable version of the Firefox browser (http://mozilla.com/firefox/ ).

Why Firefox? I view this browser as a great tool for web developers. It's as essential as my HTML editor, graphics, and FTP programs. Firefox has great features that we'll be taking advantage of to help us streamline the design-creation and template-development process. In addition to those built-in features, such as the DOM Source Selection Viewer and adhering to CSS2 (and CSS3) standards as specified by the W3C, FireFox also has a host of extremely useful extensions such as the Web Developer Toolbar and Firebug, which I recommend to further enhance your work flow (I'll discuss these two extensions in detail in Chapter 4).

Note

Get the extensions now: You can get the Web Developer Toolbar from https://addons.mozilla.org/en-US/firefox/addon/60 and FireBug from https://addons.mozilla.org/en-US/firefox/addon/1843.

Be sure to visit the developers' sites to learn more about each of these extensions.

We'll be developing for Firefox first, then IE and other browsers

In addition to Firefox having all the helpful features and extensions, IE6 and even IE7 have a thing called quirks mode, which we will learn all about in Chapter 4. While Microsoft has attempted a lot of improvements and tried to become more W3C compliant with IE7 and now IE8, there are still some CSS rendering issues between this browser and others.

Your best bet will be to design for Firefox first, and then, if you notice things don't look so great in IE6, IE7, or IE8, there are plenty of standardized fixes and workarounds for these two browsers, because their "wonks" are just that—wonks and well documented.

As we'll learn in Chapter 4, if you design only looking at one version of IE, then find it a mess in Firefox, Opera, or Safari, or the new Google Chrome, you're going to have a much harder time fixing the CSS you made for IE in a more "standards-compliant" browser.

Firefox doesn't have to become your only browser. You can keep using IE or any other browser you prefer. I myself prefer Opera for light and speedy web surfing. As a designer who works with and for other creative Mac-based professionals, I regularly check my work in Safari. Nevertheless, Firefox is one of my key web development tools.

 

Summary


To get going on your Joomla! 1.5 template design, you'll want to understand how the Joomla! CMS works and have your head wrapped around the basics of the Joomla! project you're ready to embark on. If you'll be working with a more technical Joomla! administrator and/or PHP developer, make sure your development installation, or sandbox, will have the same Joomla! extensions the final site needs to have. You'll want to have any software tools that are recommended installed and ready to use as well as brush up on those web skills, especially XHTML and CSS. Get ready to embark on designing a great template for one of the most popular, open source, CMSs available for the Web today!

Up next in Chapter 2, we'll plan our template design and develop it using my own rapid design comping technique. You'll end up with a working XHTML/CSS mockup that can be easily modified into a fully functional Joomla! 1.5 template.

About the Author
  • Tessa Blakeley Silver

    Tessa Blakeley Silver's background is in print design and traditional illustration. She evolved over the years into web and multi-media development, where she focuses on usability and interface design. Prior to starting her consulting and development company hyper3media (pronounced hyper-cube media) http://hyper3media.com, Tessa was the VP of Interactive Technologies at eHigherEducation, an online learning and technology company developing compelling multimedia simulations, interactions, and games that met online educational requirements like 508, AICC, and SCORM. She has also worked as a consultant and freelancer for J. Walter Thompson and The Diamond Trading Company (formerly known as DeBeers) and was a Design Specialist and Senior Associate for PricewaterhouseCoopers' East Region Marketing department. Tessa authors several design and web technology blogs. Joomla! Template Design is her first book.

    Browse publications by this author
Joomla! 1.5 Template Design
Unlock this book and the full library FREE for 7 days
Start now