Tuesday, December 4, 2012

How To Add A New Module Position In Joomla Template?

After creating or installing new module in joomla,you may struck how to create a position for the new module and for existing module. Let us see how to add a new module position in an existing joomla template.
Now, let us see step by step process setting position

Step 1: Getting Started

For Joomla 1.6,1.7,2.5:
Go to admin→template manager→select template
Template master files are listed here. Then click “Edit main page template”. The index.php file of the selected template will open.
For Joomla 1.5:
Open the file “<your Joomla! home>/templates/template_name/index.php” for editing and determine where your new position will be on the page.

Step 2: Adding Position to index.php

Insert the following code where you want to place new module.
Syntax:  <jdoc:include type=”modules” name=”position name” /> Example:
<?php if ($this->countModules( ‘newposition’ )) : ?>
<div class=”class_name”>
<jdoc:include type=”modules” name=”newposition” />
</div>
<?php endif; ?>
The countModules method can be used within a template to determine the number of modules enabled in a given module position. This prevents empty regions from being defined in the template output. You can add style for class_name in css file.
Note: In some joomla templates content are rendered from layouts folder in index.php <your Joomla! home>/templates/layouts

Step 3: Edit the file templateDetails.xml

Go to <your Joomla! home>/templates/template_name/ templateDetails.xml
Open the Template’s templateDetails.xml file and find the <positions></positions> start and end tags .Then add the new position <position>newposition</position>
Ensure that the name of the module matches the module position you added to the index.php file in step 2.

Example:

         position-0
         position-1
         position-2
         position-3
         position-4
         position-5
         position-6
         newposition


The new positions should now be available in the module manager and modules can now be assigned. Once assigned they will appear on your template.
To visualize all modules set on a template by calling the “tp=1” query string on the front-end. For that you need to enable the module position in admin.
Go to template manager→ click options → enable preview module position

After that you can see all of the existing template locations in your browser by adding “?tp=1” to the end of your normal URL.
Note: Only  Joomla 1.6,1.7&2.5 has GUI mode to enable/disable the Preview module position in back-end.  Joomla 1.5 Doesn’t have this option. you can directly append “?tp=1”
(for example, “http://www.yoursite.com/?tp=1“).



visit my site for more adventure Social network, Gaming network, Free Internet TV and Live Sport Streams,more Tutotrials, News and Entertainment blog. visit here - http://9jatown.com

No comments:

Post a Comment