Making the switch: Building websites the Joomla! way
If you're new to Joomla! and to Content Management Systems (CMSes), you'll find creating sites using a CMS takes a bit of getting used to. Even if you have some experience building websites, you'll have to adapt to a different way of working. But it's worth your while, and Joomla! will make it easy on you—really! Before we explore the example site you've installed in the last chapter, we'll have a brief look at just what's so different about building websites with Joomla!.
As you may know, ages ago—at least before 2005 when Joomla! came to be—most websites were handcrafted. Creating a website meant creating pages. For every web page you needed, you had to create an HTML document. You would design a basic page layout and reuse that over and over again, adding new pages and adapting the layout to fit the type of content. Whatever tool you used—Adobe (then Macromedia) Dreamweaver, Microsoft FrontPage, or maybe a plain text editor—you would be designing, coding, editing, or building the same web page your visitors would see on your website.
Getting anything published on the Web meant uploading pages (HTML documents) to a web server. Adding and updating content or managing hyperlinks was basically handicraft. You'd open a page in an editor, make changes, and upload it to the web server again. Those were the bad old days of static websites.
However, those days are long, long gone. Today, most websites are dynamic. They use a CMS to make it easier to create and manage content. These CMS-based sites are either built from scratch (by web programmers creating a custom CMS to meet specific client requirements) or based upon a generic CMS such as Joomla! that can be customized and expanded. And it's that dynamic bit that makes working with a CMS so all-new and different.
Sorry, web pages have ceased to exist
Okay, now brace yourself for the main difference between the static old school approach and building websites using a CMS such as Joomla!: there are no web pages.
Of course, a visitor browsing your site still experiences that website as—basically—a collection of pages. In Joomla!, however, the page your visitor sees isn't really a page. Rather, it's a collection of little blocks of interactive data that the CMS pulls from a database. These blocks can be arranged and combined into web pages in many different ways.
As soon as your visitor clicks on a link, he actually sends a request to Joomla! to assemble bits and pieces of data to present a full web page. If your site visitor clicks on Home, he'll see a page consisting of headings, images, and teaser texts. If he clicks on a Read more link, a new mix of data is displayed. This can consist of the same article heading from the home page, possibly the same intro text and image (now combined with the full body text) links to related articles, banners, and different menu options.
When creating static websites, the HTML page you designed would be the exact same HTML page the site visitor would see. This one-to-one relationship has gone out the window. Behind the scenes, in Joomla!, you won't be editing pages—after all, there are no pages in Joomla!. To change the output (the web page) you edit the different building blocks. These blocks can be any part of the final page: the main article, a menu entry, a banner, or a list of hyperlinks to related items.
Tip
A CMS is like a coffee machine system
In a way, a CMS works like a big multi-option coffee machine. The user presses a button to select any of the available options; the machine invisibly fetches all of the required ingredients and mixes these to serve a cup of fresh coffee, latte, frappuccino, or decaf.
This is similar to the way a CMS serves content. The user clicks on a link, the mighty machine gathers whatever combination of content parts is needed from the database to complete this particular order and it pours the output into a coffee cup—I mean, a web page.
Why is this a good thing?
The dynamic approach of CMSes, such as Joomla!, makes creating websites much more flexible. You don't have to manually create dozens of rigid content pages, copying menus and other common elements from page to page as you extend your site. Instead, you'll choose a basic page layout and add any combination of building blocks you need:
- Do you want a home page with four headings, teaser texts, Read more links, a main menu, a random image, a login form, or a list of links to popular articles? You can do this easily, as the Joomla! CMS allows you to combine different blocks of content into your home page. No programming skills needed!
- If your site has a section about digital photography, do you want all content pages about DSLR cameras to display a special banner to attract attention to your special newsletter on the subject? In Joomla!, it's a breeze.
- Would you like to have different items on your home page on every day of the week? Do you want to set a particular starting date and an ending date for publishing your articles? It's all possible. While you're on a holiday, you can have your home page automatically updated with the articles you prepared beforehand!
To summarize: you've got the power! You determine what "content blocks" Joomla! packs together onto any specific page and you also set the order and the layout of these blocks on the browser screen.
All of this magic is made possible by Joomla!'s built-in PHP wizardry. It uses the powerful PHP scripting language to communicate with a database, gathering just the blocks of data you need and presenting them the way you want.
A website built of blocks
Now what does this building blocks thing look like in real life? The following is an illustration of Joomla!'s page building system dissected:
A web page in Joomla! basically consists of these three parts: a base layout (1), the main content block (2), and as many function blocks as you like (3).
- (1) The base layout: This defines the presentation of all content (the amount of columns, background colors, header graphics, and so on). This base layout also contains "positions" (spaces Joomla! can fill with its content blocks). In Joomla!, this base layout is defined in a template. Generally, you set the template once and forget about it. It controls the graphic design; it's not part of your daily routine of content management. You'll learn more about using templates in Chapter 11.
- (2) The main content area: This is the essential part; it contains the cold hard content. Whether you'll publish an article, show a contact form, or a photo gallery it will appear here. In Joomla!, this area is called the mainbody. In most cases, the mainbody appears in the middle of the page.
- (3) The blocks around the main content area: Examples are the Main Menu in the left-hand sidebar, Latest News, and so on. These blocks are called modules. Modules can contain advanced functionality: menus, polls, login forms, dynamic lists, random images, slideshows, and so on. Anything in the top, left, right, or bottom of a Joomla! page is displayed using modules. The default Joomla! installation comes with dozens of modules; the system is very extensible.
To summarize: the template functions as a frame; the mainbody is the central and essential building block that fits right in the middle; and modules are blocks that you can add and arrange around that, just the way you like, to add essential functions (or just fun and pizzazz) to your site.