Joomla cho người mới bắt đầu part 25 potx

10 126 0
Joomla cho người mới bắt đầu part 25 potx

Đang tải... (xem toàn văn)

Thông tin tài liệu

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 funconality covered, chances are you'll want more. Maybe your client has some specic requirements, or maybe you just want to increase the wow factor of your site and add some eye candy or cool eects. 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 funconality that's not built into the basic Joomla! installaon (or "core"), you'll very likely nd it in the huge treasure house that's called the Joomla! extension database. Extensions are lile pieces of soware that you can download and install to become part of the backend, extending Joomla!'s capabilies. 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 Geng 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 essenal funconality so you can't even uninstall them. Joomla!'s search funcon, it's menu system, or it's Contacts funconality 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 possibilies 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 dierent 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, somemes providing lots of administraon opons and sengs. 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 funconality. 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 posions ('le', 'right', and so on) are predened by the template designer. In the following screenshot, you can see the default template is packed with module posions: Download at Wow! eBook WWW.WOWEBOOK.COM Chapter 10 [ 249 ]  Tiny extensions called Plugins. These are usually minor enhancements, such as an extra buon 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 praccally there are important dierences between these three extension types, the boom line is that they all extend Joomla!'s capabilies by adding extra funconality in the backend of your site. You just choose the tool that does the job—somemes this means you'll use a component, somemes a module, and somemes a plugin (and somemes even a combinaon). In the Extensions menu you'll also nd Template Manager and Language Manager. We won't cover them here as they have very specic 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 Wrien by) to a language of your choice. See Chapter 2 on installing Joomla!. Download at Wow! eBook WWW.WOWEBOOK.COM Geng 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! installaon, you can nd thousands of addional extensions developed by third pares 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 oer a wealth of new possibilies, whether it's beer content presentaon (through menus, link lists, and galleries), user interacon (using forums and comments), or backend tools (interface enhancements). Browse the JED categories (navigaon systems, forums, and so on) every now and again and keep an eye on the New and Noteworthy secon. 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 oen give you a good indicaon 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 coee 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. Somemes, developers require registraon 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 Newsash to the home page When your site grows, it's important to make sure the home page properly reects all of the content categories to prevent your valuable new content from staying unnoced. Using the Front Page Manager (see Chapter 4) you can set a selecon of arcles to show in central area of the home page. But there are more ways to aract aenon to specic arcles. In this case, we'll use the Newsash module to show a random arcle intro text from a selected category each me the page is loaded. Every me the visitor returns another item will be displayed in the Newsash module posion. 1. Navigate to Extensions | Module Manager. It may be hard to locate the Newsash module in this mul-page lisng, but there's a quick way to nd it. In the Type drop-down box, select mod_newsash. Now just this module is shown: 2. Click on the Module Name (Newsash) to edit the module properes. In the Title box, replace the default tle Newsash 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 Posion: right to display the module in the right-hand side column. Download at Wow! eBook WWW.WOWEBOOK.COM Geng the Most out of Your Site: Extending Joomla! [ 252 ] 5. In the Menu Assignment secon, select Select Menu Item(s) from the List and set the module to show on the Home page only. 6. In the Module Parameters secon, select the Category from which Joomla! should show one or more arcle intro texts. 7. In the Layout drop-down box, choose Randomly choose one at a me. This will make the module display one random arcle from the selected category each me the visitor revisits this page (if you were to choose Horizontal or Vercal here you could display a number of arcle intro texts listed either horizontally or vercally). 8. Set Show Images to Yes; this way the images in the arcle's intro text will be dis- played. Images will only t if they aren't wider than the available module posion, as bigger images aren't resized automacally. 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 arcle into a hyperlink. 10. Select Read more Link: Show to show a Read more link aer the intro text. 11. Select Arcle Title: Yes to show the arcle 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 Newsash module is shown above the Poll in the right-hand side column: What just happened? The Newsash module can help you aract aenon to a specic set of arcles; every me the page is revisited (reloaded in the visitor's browser), a new random arcle intro text from the selected category is shown. Don't let the name Newsash 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 dierent content at every revisit, without having to actually refresh your site. Download at Wow! eBook WWW.WOWEBOOK.COM Geng the Most out of Your Site: Extending Joomla! [ 254 ] Have a go hero – change the Newsash settings As with almost any module, the sengs and parameters greatly determine the output of the Newsash. In the following screenshot, you can see what the output can look like if you change the posion and layout sengs: Download at Wow! eBook WWW.WOWEBOOK.COM Chapter 10 [ 255 ] Here, the Posion is set to Footer and the Layout is set to Vercal. In # of Arcles we've entered 2 to display two arcle intro texts from the Lectures category in one column. This way, the Newsash module allows you to display arcle intro texts from a selected category, something you can't achieve with the Front Page sengs only. The Front Page Blog Layout shows arcles 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 Newsash a few mes on the same page. Is that possible? Yes, you can have mulple 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 Newsash 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 Newsash 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 opon—instead of copying an exisng 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 secon). Creating a custom HTML block Imagine you want to add a block of informaon on your site, for example a short announcement in a sidebar. You can't use an arcle for this, as this will be displayed in the main content area. But there's a niy lile 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 Painngs, the SRUP people would like to announce a forthcoming series of arcles. Let's use the Custom HTML module to achieve this. 1. This module isn't in use yet, so we can't adjust an exisng 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 Geng 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 Painngs). Set Show Title to No. 4. Make sure Posion is set to le; the module will display below the Main Menu (which is also assigned to this module posion). 5. In the Menu Assignment secon, choose Select Menu Item(s) from the List and in Menu Selecon: select the Ugly Painngs 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 buons. 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 Geng 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! installaon, you can nd thousands of addional extensions developed by third pares on the Web. Most of these are listed on http://extensions .joomla. org, the Joomla!

Ngày đăng: 04/07/2014, 17:20

Tài liệu cùng người dùng

Tài liệu liên quan