Publication joomla modules - Part 9
First of all, distinguish between the terms "block" and "position". a "block" corresponds to a block <div> (html tag) above and "position" is the term joomla we will consider in the future.
We propose to adopt the following organization for our presentation of the site:
- The block "top" displays the modules published in the "banner".
- The block "left" shows the modules published in the "left".
- The block center displays the MainBody "ie the main body of the site.
- Block "Right" displays the modules published in the "right".
- The block "down" displays the modules published in the "bottom".
A module is a component of your web page to display a menu (example: module main menu), a form pre-installed (Identity Module) or a component later.
A module is displayed in a "position of publication".
In the administration console of your site, you can see a list of pre-defined positions in the "Site -> Manage Templates -> Module Positions":
You can edit this list by adding new positions as you can also rename your convenience an existing position.
For example, if you rename the position "left" to "left", you must assign to the position "left" module already assigned to "left". To do this, go to the menu management modules of the site: "Module -> Site Modules". Here we list all the modules available for each position to which it is assigned.
However, note that only the positions supported in your template will be displayed in your site. For our example template "TemplatePerso" because we want the following format:
- The block "top" displays the modules published in the "banner".
- The block "left" shows the modules published in the "left".
- The block center displays the MainBody "ie the main body of the site.
- Block "Right" displays the modules published in the "right".
- The block "down" displays the modules published in the "bottom".
Only the modules assigned to positions ( "banner", "left", "right", "bottom") will be displayed in your site http://localhost/MonSitePerso. Modules assigned to these positions are the only ones that will be published.
Module assigned to "user1", for example, will not be displayed in your template. It is displayed against when using the standard template "rhuk_solarflare_ii" because the file "index.php" corresponding "c: \ xampplite \ htdocs \ MonSitePerso \ Templates \ rhuk_solarflare_ii \ index.php") uses this position line 122 via the php code: <? php mosLoadModules ( 'user1', -2);?>.
Returning to the template. To achieve the desired view, here's the modified code of the body of your index.php file:
<div id= "conteneur">
<div id="haut"><?php mosLoadModules ( 'banner' ); ?></div>
<div id="gauche"><?php mosLoadModules ( 'left' ); ?></div>
<div id="centre"><?php mosMainBody(); ?></div>
<div id="droit"><?php mosLoadModules ( 'right' ); ?></div>
<div id="bas"><?php mosLoadModules ( 'bottom' ); ?></div></div>
You have seen, to display in the template modules assigned to a position, we use the function mosLoadModules. The syntax of this function is:
We will return in the next paragraph.mosLoadModules ( $nom_position [, $style] ).
For now, consider the result in your browser after saving changes.
This time, a component image is displayed in banner and content in the different positions of the page. The content comes with the standard Joomla installation.





joomlaservices
joomlaservices
394295112
joomlaservices
+91-9853790816
joomlaservices

Comments