Modules in Joomla: Banners – Random Image

This module displays a random image from the selected directory. Specifically, every time someone visits the site, Joomla randomly pulls a different image from the images folder that you have created. From the Site type module, from the Module Manager page, click the Site link to display Site type modules and then click the New button to create a new module. You will be prompted to select the module type. From the list of displayed module types (refer to Figure 8-3), choose Random Image module type. Let’s assign the title as Images Flash to the new module (see Figure 8-30).

The Image Type field is used to specify the type of image to be displayed (JPG, PNG, GIF, and so on). The default is JPG.

In the Image Folder field, select the folder from which the images are to be displayed. The path specified is relative to the web site URL. Enter the folder name images, which is where you uploaded a few images during the creation of new articles.

The Link field is used to specify the URL of the web site to which you want the visitor to navigate if the image is clicked. You can enter www.bmharwani.com (although it can be any URL). In the Width (px) field, you specify the width of the image in pixels. The image will be resized to this width. In the Height (px) field, you specify the height of the image in pixels. The image will be scaled to the given height. Specify the width and height of the image to be 150 px. Let the Position to display the module be position-7 (right-top side of the web site). After entering the information, click the Save & Close button to save the module.

Output on the web site should appear as shown in Figure 8-31. It displays a random image picked from the images folder under the title Images Flash.

If you click the Refresh button, the picture should change, as shown in Figure 8-32.

Source: Harwani B M (2015), Foundations of Joomla!, Apress; 2nd ed edition

Leave a Reply

Your email address will not be published. Required fields are marked *