Вы находитесь на странице: 1из 5

Rafael R.

Emata 10-G
Module positions
-Module positions are placeholders in a template. They identify positions within the
template and tell the Joomla! application where to place output from modules
assigned to a particular position. The template designer has complete control over
module positions, creating variations between templates and the respective Joomla!
default positions assigned to modules in the installation sample data.
How to add a new module position ?

The first step in adding a new module position to your active template is to edit the
templateDetails.xml file. This is located under the template folder. Once opened for code editing,
locate the <postions></positions> tags. Existing positions will appear similar to the following:

The new position must be added between <position></postion> tags as they are for the other
module positions.

Second step, Add the new module position to the template module styles by editing the
gk.const.php file located in /lib/framework.

Open the .php file and add your new module to the array (see example below). The style for the
module may also be set here. In this example it is none, but it may be something else, such as
gk_style.

A new module position has now been established and it may be selected from module positions
in the Joomla admin panel. Lastly, the module must be added to the template.
Last, very important, step. All template files are located in the layouts folder
(gk_NameOfTemplate\layouts\default.php). Default.php is the default template view, and it
contains code blocks located in layouts/blocks. The module may be added directly into the
default.php file or to one of these blocks.
You have to know a little HTML and default template module positions to know where exactly
add new module position. See my example, where I showed where to add new module below
position top1 but above top2, so between them. Remember about <div> ..</div>and
<section>..</section> if they appears in template code.

By the way, using firebug tool (add-on for firefox or chrome browser) should help you
understand the structure of each template.
To insert your own (new) module paste the following code:
<?php if($this->modules('myposition')) : ?> <div class="newstyle">
<jdoc:include type="modules" name="myposition"
style="<?php echo $this->module_styles['myposition']; ?>" />
</div> <?php endif; ?>

During paste process please connect together second and third line, but must be small space
between them. To make the module match the look of the template, you may need to adjust the
CSS files, like following (it will add red thin border).
.newstyle {

outline:1px solid red;

min-height:5px; }

Module Manager
-Modules are the blocks of content in your site and are distinctively separate from
your main content area. For example, a module may appear to the left, right, above,
or below your main article content. The Module Manager allows you to customize
each module to your preference.
Extensions Manager
-This screen is accessed from the back-end Joomla! administrator panel. It is used to
install extensions into your Joomla! installation. Some examples of extensions are
plug-ins, components, and site templates.

Вам также может понравиться