1. Trang chủ
  2. » Công Nghệ Thông Tin

Thiết kế web với joomla 1.6(5).x part 43 potx

11 115 0

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

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 11
Dung lượng 1,97 MB

Nội dung

Part III: Working with Components, Modules, and Plugins 390 Tip To find a section’s ID number, view the section in the Section Manager. To find a category’s ID number, view the category in the Category Manager. In both cases the ID number appears in the far right column, under the column heading ID. The Advanced parameters section contains caching options: l Caching: This control allows you to exempt a specific module from the site’s caching, as set in the Global Configuration. Select the option No Caching to prevent the contents of this Module from being cached. The default setting is Use Global. l Cache Time: The time, in minutes, you want the contents to be cached. Enter an integer value here. The default value is 900 minutes, meaning that after 900 minutes the system will re-create, or refresh this module. Note this control is only meaningful if the caching for the module is enabled. To add a Most Read Content module to your site, follow these steps: 1. Log in to the admin system of your site. 2. Go to the Extensions menu and select the Module Manager option. The Module Manager loads in your browser. 3. Click the New icon on the toolbar at the top of the Module Manager. The New Module dialogue opens. Refer to Figure 17.2. 4. Select the option Most Read Content and then click the Next button. The Most Read Content Module dialogue loads in your browser. 5. In the Title field, type a name for the module. This is a required field. 6. Set the option called Enabled to the value Yes. 7. Set the Position control to assign the module to a position on the page. 8. Set the Menu Assignment to specify the pages upon which the module will appear. 9. Select any additional options or parameters you wish; all other fields are optional. 10. Click the Save icon on the toolbar at the top right to save your new module. The sys- tem creates the module, close the dialogue and return you to the Module Manager. Tip You can create multiple instances of this module type then use the Category ID and Section ID to create mod- ules to display the most popular items in each of the various sections of your site. Newsflash The Newsflash module provides a way for you to insert into a module position a fixed or rotating content item. The content displayed can be drawn from either a dedicated category or from existing Chapter 17: Working with the Site Modules 391 content categories. This feature is a useful because it enables you to place, typically, a small piece of text that rotates to display news, announcements, or any other items you want to attract the visi- tors’ attention, as shown in Figure 17.24. In the default installation, with the sample data installed, there is one Newsflash module enabled and published. The module is called simply Newsflash and it is assigned to the Top module posi- tion on all pages of the default site. Note The system name for this module type is mod_newsflash. The Parameters section is divided into two sections: Module parameters and Advanced parameters, as shown in Figure 17.25. FIGURE 17.24 The front-end output of the default Newsflash module with the sample data loaded. Here the module is shown in the Top module position of the default template. Newsflash module Part III: Working with Components, Modules, and Plugins 392 FIGURE 17.25 The Newsflash module parameters. The Module parameters section contains the following controls: l Category: Use this control to select a content category for display by the module. If you do not designate a specific category, the module will display items from all categories. l Layout: The label for this control is a bit deceptive. The combo box contains three options: Randomly choose one at a time, Horizontal, and Vertical. The last two do indeed impact the layout, but they also specify that the module does not randomize article, but rather shows a fixed display of articles. In contrast, the default choice, Randomly choose one at a time, randomizes the articles selected and displays them one at a time. Note that this parameter is also related to the # of Articles parameter, below. l Show Images: Decide whether the module shows images associated with the content item. The default setting is No. l Title Linkable: Decide whether the article title will; function as a clickable hyperlink that leads to the article. This control provides you with the option to break with the Global Configuration setting for this parameter. The options here are: Use Global, No and Yes. The default is Use Global. Chapter 17: Working with the Site Modules 393 l Show last separator: Set this to Yes if you want to show a separator in the module imme- diately after the last article. l Read more… Link: Elect to show or hide the read more link at the end of each article. l Article Title: Show or hide the article’s title. l # of Articles: Set the number of articles to be displayed or randomized. If this is left blank the system will display five articles. l Module Class Suffix: This field allows you to specify a suffix that will be automatically appended to all CSS styles that affect this module. The use of a specified suffix makes it possible for you to style this module individually. Tip The ordering of the appearance of the items in the Newsflash is dictated by the order in which the articles are displayed within the Category Manager in the Article Manager. The Advanced parameters section contains caching options: l Caching: This control allows you to exempt a specific module from the site’s caching, as set in the Global Configuration. Select the No Caching option to prevent the contents of this module from being cached. The default setting is Use Global. l Cache Time: The time, in minutes, you want the contents to be cached. Enter an integer value here. The default value is 900 minutes, meaning that after 900 minutes the system will re-create, or refresh this module. Note this control is only meaningful if the caching for the module is enabled. To add a Newsflash module to your site, follow these steps: 1. Log in to the admin system of your site. 2. Access the Module Manager. To do so, go to the Extensions menu and select the Module Manager option. The Module Manager will load in your browser. 3. Click the New icon on the toolbar at the top of the Module Manager. The New Module dialogue opens. Refer to Figure 17.2. 4. Select the option Newsflash and then click the Next button. The Newsflash Module dialogue loads in your browser. 5. In the Title field, type a name for the module. This field is required. 6. Set the Enabled option to Yes. 7. Set the Position control to assign the module to a position on the page. 8. Set the Menu Assignment to specify the pages upon which the module appears. 9. Select any additional options or parameters you wish; all other fields are optional. 10. Click the Save icon on the toolbar at the top right to save your new module. The sys- tem creates the module, closes the dialogue, and returns you to the Module Manager. Part III: Working with Components, Modules, and Plugins 394 Tip This module is useful for both showing short news items and announcements and for displaying short versions — teasers — of articles. In the sample data you can see what is probably the most common use, that is, the Newsflash is assigned to a prominent module position, and then configured to display short content items drawn from a dedicated category. In the case of the Joomla! 1.5.x sample data, the dedicated category is named Newsflash and is part of the News section. Poll The Polls module allows you to display polls created in the Polls component inside module posi- tions, as shown in Figure 17.26. The module is tied closely to the Polls component and cannot dis- play content other than that generated by the component. Cross-Reference The Polls component and module are discussed in more detail in Chapter 15. FIGURE 17.26 The front-end output of the Polls module, showing the poll from the sample data. Poles module Chapter 17: Working with the Site Modules 395 The default system with the sample data installed shows one Polls module in use. The module is named Polls and is assigned to the right module position holder on various pages where it displays the Joomla! Is Used For? item from the Polls component. Note The system name for this module type is mod_polls. The Parameters section is divided into two sections: Module parameters and Advanced parameters, as shown in Figure 17.27. The Module parameters section contains two controls: l Poll: Select one of the Polls created in the Polls Component. This is a required field. l Module Class Suffix: This field allows you to specify a suffix that will be automatically appended to all CSS styles that affect this module. The use of a specified suffix makes it possible for you to style this module individually. FIGURE 17.27 The Poll module parameters. Part III: Working with Components, Modules, and Plugins 396 The Advanced parameters section contains caching options: l Caching: This control allows you to exempt a specific module from the site’s caching, as set in the Global Configuration. Select the No Caching option to prevent the contents of this module from being cached. The default setting is Use Global. l Cache Time: The time, in minutes, you want the contents to be cached. Enter an integer value here. The default value is 900 minutes, meaning that after 900 minutes the system will re-create, or refresh this module. Note this control is only meaningful if the caching for the module is enabled. To add a Polls module to your site, follow these steps: 1. Log in to the admin system of your site. 2. Access the Module Manager. To do so, go to the Extensions menu and select the Module Manager option. The Module Manager loads in your browser. 3. Click the New icon on the toolbar at the top of the Module Manager. The New Module dialog box opens. Refer to Figure 17.2. 4. Select the option Polls and then click the Next button. The Polls Modules dialog box opens in your browser. 5. In the Title field, type a name for the module. This is a required field. 6. Set the Enabled option to Yes. 7. Set the position control to assign the module to a position on the page. 8. Set the Menu Assignment to specify the pages upon which the module appears. 9. Choose a poll to display using the Poll parameter. 10. Select any additional options or parameters you wish; all other fields are optional. 11. Click the Save icon on the toolbar at the top right to save your new module. The sys- tem creates the module, closes the dialog box, and returns you to the Module Manager. Random Image The Random Image module displays a selection of images in a module position, according to the parameters you set, as shown in Figure 17.28. Images are drawn from a single directory that you designate in the configuration parameters. The display of the images is randomized. There are few options for controlling this module. Chapter 17: Working with the Site Modules 397 FIGURE 17.28 The front-end output of the Random Image module. Random Image module Note that the default system with the sample data installed includes a Random Image module, but the module is neither published nor assigned to any pages. The default module is named Random Image. Note The system name for this module type is mod_random_image. The Parameters section is divided into two sections: Module parameters and Advanced parameters, as shown in Figure 17.29. Part III: Working with Components, Modules, and Plugins 398 FIGURE 17.29 The Random Image module parameters. The Module parameters section contains the following options: l Image Type: Enter file extensions in this blank to filter the images that will be displayed by the module. You can enter multiple file types, separated by commas. Note that you do not need the leading “.” as in “.jpg.” The default setting for this Parameter is jpg. l Image Folder: Specify the address of the directory that contains the images you want to display. The path you enter here should relative to the site’s URL. l Link: If you want to hyperlink the images to a specific URL, enter the full URL here. l Width (px): Enter an integer value to force the image to a specific width, as measured in pixels (px). If you do not specify a value here the system will use the original file’s dimensions. l Height (px): Enter an integer value to force the image to a specific width, as measured in pixels (px). If you do not specify a value here the system will use the original file’s dimensions. Chapter 17: Working with the Site Modules 399 l Module Class Suffix: This field allows you to specify a suffix that will be automatically appended to all CSS styles that affect this module. The use of a specified suffix makes it possible for you to style this module individually. The Advanced parameters section contains caching options: l Caching: This control allows you to exempt a specific module from the site’s caching, as set in the Global Configuration. Select the option No Caching to prevent the contents of this module from being cached. The default setting is Use Global. l Cache Time: The time, in minutes, you want the contents to be cached. Enter an integer value here. The default value is 900 minutes, meaning that after 900 minutes the system will re-create, or refresh this Module. Note this control is only meaningful if the caching for the Module is enabled. To add a Random Image module to your site, follow these steps: 1. Log in to the admin system of your site. 2. Access the Module Manager. To do so, go to the Extensions menu and select the Module Manager option. The Module Manager will load in your browser. 3. Click the New icon on the toolbar at the top of the Module Manager. The New Module dialogue opens. Refer to Figure 17.2. 4. Select the option Random Image and then click the Next button. The Random Image Module dialog box opens in your browser. 5. In the Title field, type a name for the module. This field is required. 6. Set the Enabled option to Yes. 7. Set the position control to assign the module to a position on the page. 8. Set the Menu Assignment to specify the pages upon which the module appears. 9. Enter the path to the directory containing the images in the module parameter named Image Folder. This field is required. 10. Select any additional options or parameters you want; all other fields are optional. 11. Click the Save icon on the toolbar at the top right to save your new module. The sys- tem creates the Module, closes the dialogue, and returns you to the Module Manager. Tip The Random Image module is useful but is rather lacking in features. Given the inability to control the display time, order, or re-sizing of the images, many administrators who desire this feature resort to a third-party extension. A quick review of the Joomla! Extensions site shows that a number of alternatives to using the core Random Image module exist. [...].. .Part III: Working with Components, Modules, and Plugins Related Articles The Related Articles module displays a list of links to articles that are considered to be related to the article the user is viewing . feature resort to a third-party extension. A quick review of the Joomla! Extensions site shows that a number of alternatives to using the core Random Image module exist. Part III: Working with. items drawn from a dedicated category. In the case of the Joomla! 1. 5 .x sample data, the dedicated category is named Newsflash and is part of the News section. Poll The Polls module allows you. Module Manager. The New Module dialog box opens. Refer to Figure 17 .2. 4. Select the option Polls and then click the Next button. The Polls Modules dialog box opens in your browser. 5. In the

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