10 Getting the Most out of Your Site: Extending Joomla! When you've got your basic Joomla!-powered site up and running, and you've got all of your content and funconality covered, chances are you'll want more. Maybe your client has some specic requirements, or maybe you just want to increase the wow factor of your site and add some eye candy or cool eects. Doing more things with Joomla! and make your site stand out from the rest of them—that's where extensions come in. The real power of Joomla! lies in its extensibility. If you need any funconality that's not built into the basic Joomla! installaon (or "core"), you'll very likely nd it in the huge treasure house that's called the Joomla! extension database. Extensions are lile pieces of soware that you can download and install to become part of the backend, extending Joomla!'s capabilies. In this chapter, you'll: Use Joomla!'s core extensions Download and install extensions Put extensions to work to enhance the frontend of your site or your backend workspace Download at Wow! eBook WWW.WOWEBOOK.COM Geng the Most out of Your Site: Extending Joomla! [ 248 ] Don't let the term extension confuse you; some extensions are part of the Joomla! core. They are integrated into the basic Joomla! package. Many of these provide essenal funconality so you can't even uninstall them. Joomla!'s search funcon, it's menu system, or it's Contacts funconality are examples of these pre-installed extensions. This means you already have some extensions experience. As soon as you start using Joomla!, you deploy extensions. In this chapter, we'll focus on the possibilies of some core extensions that we haven't covered yet and also on using third-party extensions. We'll install some must-have extensions and nd out how they work. Extensions in all shapes and sizes Before digging into the wonderful world of extensions, it's good to know they come in dierent shapes and sizes. Basically, there are three types of extensions: The big ones called Components. You manage them through a special Components menu in the backend. They are the most comprehensive extensions, somemes providing lots of administraon opons and sengs. Component output is usually displayed in the main content area. An example is the Contacts components (to manage a system of contacts, contact details, and contact forms). The medium ones called Modules. Modules are "blocks" that contain special funconality. You've already seen examples at work, such as the menu module. You manage modules in Extensions | Module Manager. Modules usually turn up around the main content area: in the le-hand side and right-hand side column, or in the header and footer. These module posions ('le', 'right', and so on) are predened by the template designer. In the following screenshot, you can see the default template is packed with module posions: Download at Wow! eBook WWW.WOWEBOOK.COM Chapter 10 [ 249 ] Tiny extensions called Plugins. These are usually minor enhancements, such as an extra buon in the text editor that makes it easy to insert hyperlinks. Don't worry, you don't have to memorize this extensions typology. Although technically and praccally there are important dierences between these three extension types, the boom line is that they all extend Joomla!'s capabilies by adding extra funconality in the backend of your site. You just choose the tool that does the job—somemes this means you'll use a component, somemes a module, and somemes a plugin (and somemes even a combinaon). In the Extensions menu you'll also nd Template Manager and Language Manager. We won't cover them here as they have very specic purposes: Templates dete rm in e th e si te's layout, co lo rs, an d ty po graphy. S ee C ha pter 11 on using templates. Language les allow you to set the default language for the frontend and the backend of the site. On the frontend, this will translate all preset texts (such as Read more and Wrien by) to a language of your choice. See Chapter 2 on installing Joomla!. Download at Wow! eBook WWW.WOWEBOOK.COM Geng the Most out of Your Site: Extending Joomla! [ 250 ] Where do you get them from? Apart from the few dozen extensions that are part of the default Joomla! installaon, you can nd thousands of addional extensions developed by third pares on the Web. Most of these are listed on http://extensions.joomla.org, the Joomla! Extensions Directory (or JED, as it is fondly called by the Joomla! community): Here you'll see that extensions oer a wealth of new possibilies, whether it's beer content presentaon (through menus, link lists, and galleries), user interacon (using forums and comments), or backend tools (interface enhancements). Browse the JED categories (navigaon systems, forums, and so on) every now and again and keep an eye on the New and Noteworthy secon. Make sure to check out the Editor's Picks and the Most Popular extensions to nd some true gems. It's a good idea to read other users comments. They will oen give you a good indicaon of whether an extension is mature enough and whether the support by the developer is up to standards. The JED lists very many extensions, but there are much more extension portal sites and developer sites. Just google for "Joomla! extensions" or "Joomla! extensions must-haves" and make sure you've got enough coee prepared to embark on a long and adventurous online treasure hunt. Download at Wow! eBook WWW.WOWEBOOK.COM Chapter 10 [ 251 ] What do they cost? Many Joomla! extensions are free or available for a reasonable fee. Somemes, developers require registraon before you can download the extension. Enhancing your site using core extensions Let's explore some extensions that are part of the Joomla! core package. We'll put a few modules to work. Time for action – adding a Newsash to the home page When your site grows, it's important to make sure the home page properly reects all of the content categories to prevent your valuable new content from staying unnoced. Using the Front Page Manager (see Chapter 4) you can set a selecon of arcles to show in central area of the home page. But there are more ways to aract aenon to specic arcles. In this case, we'll use the Newsash module to show a random arcle intro text from a selected category each me the page is loaded. Every me the visitor returns another item will be displayed in the Newsash module posion. 1. Navigate to Extensions | Module Manager. It may be hard to locate the Newsash module in this mul-page lisng, but there's a quick way to nd it. In the Type drop-down box, select mod_newsash. Now just this module is shown: 2. Click on the Module Name (Newsash) to edit the module properes. In the Title box, replace the default tle Newsash with an appropriate tle. In this example, we'll enter Recent Lectures as the module tle. 3. Select Enabled: Yes to get the module to display. 4. Select Posion: right to display the module in the right-hand side column. Download at Wow! eBook WWW.WOWEBOOK.COM Geng the Most out of Your Site: Extending Joomla! [ 252 ] 5. In the Menu Assignment secon, select Select Menu Item(s) from the List and set the module to show on the Home page only. 6. In the Module Parameters secon, select the Category from which Joomla! should show one or more arcle intro texts. 7. In the Layout drop-down box, choose Randomly choose one at a me. This will make the module display one random arcle from the selected category each me the visitor revisits this page (if you were to choose Horizontal or Vercal here you could display a number of arcle intro texts listed either horizontally or vercally). 8. Set Show Images to Yes; this way the images in the arcle's intro text will be dis- played. Images will only t if they aren't wider than the available module posion, as bigger images aren't resized automacally. In this case, images are displayed if they aren't wider than the right-hand side column (which is about 230 pixels). 9. Set Title Linkable to Yes to turn the tle of the arcle into a hyperlink. 10. Select Read more Link: Show to show a Read more link aer the intro text. 11. Select Arcle Title: Yes to show the arcle tle (and not just the intro text). 12. Click on Save and click on Preview. Download at Wow! eBook WWW.WOWEBOOK.COM Chapter 10 [ 253 ] The Newsash module is shown above the Poll in the right-hand side column: What just happened? The Newsash module can help you aract aenon to a specic set of arcles; every me the page is revisited (reloaded in the visitor's browser), a new random arcle intro text from the selected category is shown. Don't let the name Newsash fool you as the module is obviously not just for news items. You can use it to show items from any category. The fun part is that you can surprise the visitor with dierent content at every revisit, without having to actually refresh your site. Download at Wow! eBook WWW.WOWEBOOK.COM Geng the Most out of Your Site: Extending Joomla! [ 254 ] Have a go hero – change the Newsash settings As with almost any module, the sengs and parameters greatly determine the output of the Newsash. In the following screenshot, you can see what the output can look like if you change the posion and layout sengs: Download at Wow! eBook WWW.WOWEBOOK.COM Chapter 10 [ 255 ] Here, the Posion is set to Footer and the Layout is set to Vercal. In # of Arcles we've entered 2 to display two arcle intro texts from the Lectures category in one column. This way, the Newsash module allows you to display arcle intro texts from a selected category, something you can't achieve with the Front Page sengs only. The Front Page Blog Layout shows arcles that are set to "Show on Front Page", regardless of the category they belong to. Using the same module twice (or more) Suppose you want to use the Newsash a few mes on the same page. Is that possible? Yes, you can have mulple instances of any module on a given page. You've already seen an example of this if you have installed Joomla! with sample data, as the sample site shows various menus together on one page (such as Main Menu, Top Menu, and User Menu). These are all copies of a single module type: mod_mainmenu. Being able to use many instances of the same module means you can also have one Newsash module showing a few teasers from Category A, and another one just below that showcasing Category B. To do this, just navigate to Extensions | Module Manager, select the Newsash module, and click on Copy in the toolbar. In the Module Manager a copy will show up named Copy of [module name]. Edit this copy to set it to show just what you want to. You'll probably want to give it another Title and set the source to another Category. Another opon—instead of copying an exisng module—is to create a new instance of the desired module from scratch; navigate to Extensions | Module Manager, click on New, and select the type of module you want (we'll cover an example in the following secon). Creating a custom HTML block Imagine you want to add a block of informaon on your site, for example a short announcement in a sidebar. You can't use an arcle for this, as this will be displayed in the main content area. But there's a niy lile module available in the Joomla! core that will help you out. It's called the Custom HTML module. Time for action – add a short content block On all the pages of Ugly Painngs, the SRUP people would like to announce a forthcoming series of arcles. Let's use the Custom HTML module to achieve this. 1. This module isn't in use yet, so we can't adjust an exisng copy of it. Let's create a new instance of it. Navigate to Extensions | Module Manager and click on New in the toolbar. Download at Wow! eBook WWW.WOWEBOOK.COM Geng the Most out of Your Site: Extending Joomla! [ 256 ] 2. In the Module: [New] screen, select Custom HTML and click on Next. 3. In the Module: [Edit] screen, enter the details. First set the Title to something appropriate (in this example, we've entered Hacking Ugly Painngs). Set Show Title to No. 4. Make sure Posion is set to le; the module will display below the Main Menu (which is also assigned to this module posion). 5. In the Menu Assignment secon, choose Select Menu Item(s) from the List and in Menu Selecon: select the Ugly Painngs link. This will make the module show up on all of the pages that this menu link leads to. 6. In the Custom Output screen, enter the text and images you'd like to show in this block. You can format the text using text editor buons. In this example, we've centered the text, made it bold, and added an image. Download at Wow! eBook WWW.WOWEBOOK.COM . language of your choice. See Chapter 2 on installing Joomla! . Download at Wow! eBook WWW.WOWEBOOK.COM Geng the Most out of Your Site: Extending Joomla! [ 250 ] Where do you get them from? Apart from. of Your Site: Extending Joomla! [ 248 ] Don't let the term extension confuse you; some extensions are part of the Joomla! core. They are integrated into the basic Joomla! package. Many of. are part of the default Joomla! installaon, you can nd thousands of addional extensions developed by third pares on the Web. Most of these are listed on http://extensions .joomla. org, the Joomla!