I have installed Mozilla Firefox 3.6 Beta 2 and enjoying using it. Its ‘persona’ feature is really cool! With one click you can install and use it. When you visit persona section you get a lots of personas so far. Take you mouse over the persona image, and your browser’s look is changed! What a live preview. Other changes to Firefox are not that much visible. I am fan of Firefox and using it for more than 2 years. In fact, I have not installed and tried IE8, after using Firefox.
This article is a continuation to the previous artcile with same title. This is an exceprt from my book – Joomla! with Flash – recently published by Packt Publishing. This article was orginally published at www.packtpub.com, and I am reposting it with their permission.
Using Flash headers
We have seen that one of the uses of Flash in Joomla! templates is as a header. By using a Flash animation in a site’s header you can create some stunning effects. As we have already seen, while designing the template, we may embed Flash animation in the header region and control the layout using an appropriate CSS stylesheet. To embed such Flash animations like these, you can use the XHTML tag. We have seen its use in the previous section. An alternative to this is showing the Flash header at some module position. There are several extensions that can be used for showing Flash objects at a module position. We will be looking at some of them next. Continue reading →
In this two-part article , we are going to use Flash for decorating our Joomla! site. On completion of this article you will be able to use:
Flash-based templates for your Joomla! website
In this article, we will mainly focus on the visual design of our site. To acquire the information presented here, it is assumed that you have some basic understanding of Joomla!’s visual design including templates, components, module position, and so on.
Adding Flash in templates
If you are familiar with Joomla! templates, then you will understand that there are two ways to display Flash in a template:
By hardcoded embedding of Flash items
By dynamically loading Flash objects at module positions
We have seen many modules that can display Flash objects. Therefore, in this section, we will be looking into the embedding of Flash objects within templates. It will also be helpful if we understand the structure of Joomla! templates.
Generally templates for Joomla! include headers in Flash. Flash animations are included in the header area of a Joomla! template. Some templates include the mechanism to show images from a specific directory. For example, the template shown in the following screenshot, available for download at http://joomlatp.com/joomla-1.5-templates/Templates-has-flash-header.html, is designed to show a Flash header comprised of the images kept in a directory:
The following sections briefly describe the structure of a Joomla! template and the ways to embed a Flash object in this template.
Structure of a Joomla! template
The look and feel of Joomla! is determined by templates. You can apply a template to the frontend as well as to the backend. Templates for the Joomla! frontend reside in the /templates directory of the Joomla! webroot, while those for the administration panel are found in the /administrator/templates directory. You can install multiple templates and apply one or more templates to the different sections. However, you must designate one default template for the site.
To designate a default template, go to Extensions | Template Manager. Select the desired template and click on the Default button on the toolbar. For assigning a template to a specific section of the site, click on a template, except the default template, and then select the section or the menu item for which you want to assign the template from the Menu Assignment section.
If you examine the directory structure of a Joomla! template, you will find at least the following subdirectories in the templates directory:
This is the main template directory. It contains some subdirectories and at least the following files under its root:
•index.php: This is the main file for a template. The basic structure of a Joomla! template is defined in this file. We will examine this file later.
•templateDetails.xml: This XML file defines the template by mentioning its designer, the different files bundled with it, the positions and parameters available, and so on.
•params.ini: This file contains the parameters and their default values. For example, a template may use several colors for theming, but users can select a preferred color as a parameter for this template, and that information is stored in this file.
This directory contains all the cascading stylesheets to be used for a Joomla! site. This directory will contain at least one stylesheet namedtemplate_css.css. It may also contain a stylesheet namedtemplate_ie6.cssand other stylesheets.
This folder may contain some definitions for the custom rendering of certain parts of the site. For example, themx_joofree2template contains two files—module.phpandpagination.php. These two files define custom module rendering and pagination for Joomla!. For more information on using HTML overrides, refer tohttp://docs.joomla.org/How_to_override_the_content_from_the_Joomla!_core.
This folder contains the images for the template. It may contain a logo image, a background image, and so on. It may also contain some subdirectories, for example, themx_joofree2template contains a subdirectoryimages/headers, where the header images for the template are stored.
Joomla! with Flash
Build a stunning, content-rich, and interactive web site with Joomla! 1.5 and Flash CS4
Build an attractive web site integrating Flash objects into Joomla!
Create stunning photo galleries with Flash transition and animation effects
Use interactive Flash-based maps, charts, animations, videos, MP3 players, logos, headers, and banners in Joomla!-based web sites
Turn your Joomla! web site into a feature-rich multimedia enhanced site through this step-by-step easy-to-follow guide enriched with screenshots
As you know, the main structure of a Joomla! template is defined in the index.php file. The file looks as follows:
<?php// no direct access defined( '_JEXEC' ) or die( 'Restricted index access' );
This line of code is to prevent direct access to the file. This is a convention to prevent direct access to any file in Joomla!. After this, the following lines define some variables for the template that will be used later on in the template:
Having defined the template variables, the template’s structure starts with some common HTML declarations as follows:
<!DOCTYPE html PUBLIC"-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"xml:lang="<?phpecho$this->language;?>"lang="<?phpecho$this->language;?>"><head>
The following block checks whether any module for position user4 is enabled. If the count of enabled modules is greater than zero, then a <div>element with an ID search is displayed, and modules specified for position user4 are displayed as children of this <div> element:
Having placed the modules for the position user4, the following block now defines where to show the site’s logo. This block of code dynamically selects the site’s logo and links that to the site’s home page:
This code block first checks whether the variable for showing a Flash header is checked or not. If it is checked, then a <div> element will be created, under which the Flash object is embedded using the tags.
The following code block is used to display the current date on the site:
The following block defines another module position. Modules designated for the user3 position will be displayed here. Note that modules are included with the <jdoc:include type=”modules” name=”position-name” /> markup:
The following code block displays another module called breadcrumbs. First, it checks whether the parameter is set to show breadcrumbs or not. If it is, then the breadcrumbs module will be displayed in the block:
<?phpif($show_breadcrumbs=="true"):?><div class="path">You are here:<jdoc:include type="module"name="breadcrumbs"/></div><?phpendif;?>
The next code block counts the number of modules available for the user1 and user2 positions and then includes the modules designated for these two positions. Note the highlighted line of code in this code block. It shows the component currently selected:
All this code in the index.php file when rendered with template_css.css and other stylesheets will display a layout like the one shown in the following screenshot:
In a Joomla! template, the site’s data comes from the database and fits in different positions. When you are planning for Flash-based Joomla! templates, you should first identify where to put the Flash objects and where to display the dynamic data for the site. In the template layout, we have seen that a suitable place for adding a Flash object are the logo and the header positions. We can also use some extensions to display Flash headers. The following sections explain how to use extensions for showing Flash logos and headers.
Using Flash logos
You can replace the ordinary image with Flash-animated logos by embedding it in that position. As we have seen earlier, Flash objects are embedded in Joomla! templates using the XHTML element. For styling purposes, you may put this element under a <div> element, as shown in the following code:
As you can see, the tag can contain child elements. We pass parameters to the Flash objects using the <param> element. For example, we have passed the name of a movie file using the highlighted tag in the previous code.
There are various types of Content Management Systems (CMS) which are widely used for building and managing a website. Although Zen Cart is very good for running an online shop, it cannot be used for building a company website. Your organization may have a website running a CMS, and as you are going to open an online shop, you may need to integrate Zen Cart with that existing CMS. In my book Zen Cart: E-commerce Application Development, I have added an chapter of integrating Zen Cart with several popular content management systems.
Adding a map to your site may be a necessity in some cases. For example, you want to show the population of countries, or you want to show a world map to your students for teaching geography. Flash maps are always interesting as you can interact with them and can view them as you like. amMap provides tools for showing Flash maps. The amMap tool is ported as a Joomla! component by yOpensource, and the component is released with the name YOS amMap. This component has two versions—free and commercial. The commercial or pro version has some advanced features that are not available in the free version.
The YOS amMap component, together with its module, allows you to display a map of the world, a region, or a country. You can choose the map to be displayed, which areas or countries are to be highlighted, and the way in which the viewers can control the map. Generally, maps displayed through the YOS amMap component can be zoomed, centered, or scrolled to left, right, top, or bottom. You can also specify a color in which a region or a country should be displayed. Continue reading →