A web page that is created by Joomla 3+ has a framework of positions. These positions will hold the content put into modules.

The content put into the modules and placed into various positions may be Custom HTML, a menu, advertisements, an RSS feed, a login form, etc.

The position names and locations are determined by the template. Different templates may have different position names and position locations.

To see the default Protostar positions and their locations, visit the following page:

Joomla 3+ - Protostar Default Module Positions

How are positions set up in Joomla 3?

position dropdown list

For a position to appear in the dropdown list of options for Position for the individual modules, the position name must be declared in the templateDetails.xml for the template. This file sits at the root of the Protostar template folder.

For a position to appear on the web page, it must be placed into the HTML that creates the page. This is done in the index.php which also sits at the root of the Protostar template folder.

There must be a line in the index.php that uses the Joomla API for pulling up that position. Here is an example of one of these lines.

<jdoc:include type="modules" name="position-8" style="xhtml" />

Within the index.php, this position may be surrounded by an HTML element such as <header>,<div>,<footer>, etc. This is so the position is located in the desired location and so that it can be styled with the CSS.

Also within the index.php, the position may surrounded with a PHP if / endif statement. This if / endif statement tests if there are any modules placed into that position. If so, then the following HTML is added to the page. If not, then the following HTML is not added to the page.

<?php if ($this->countModules('position-8')) : ?>
    <!-- Begin Sidebar -->
    <div id="sidebar" class="span3">
        <div class="sidebar-nav">
            <jdoc:include type="modules" name="position-8" style="xhtml" />
    <!-- End Sidebar -->
<?php endif; ?>

The portion of the above example that reads style="xhtml" is used if you wish to have the option of the title of the Module showing. If you never want a title to show for that position, then use style="none".

Unused Positions

The dropdown list of position names for the module may show "unused" in the list. This means that the position name is listed in templateDetails.xml, but was never placed into the HTML in index.php. 

You may choose to edit the index.php for Protostar and add these other position names within the HTML using the proper format. Copy and paste code from other areas, then edit for your new position name and other HTML information. If you use one of these unused position names, you won't need to edit the templateDetails.xml file.

Positions from other templates

The dropdown list of position names for modules will show all of the positions available for all of the front end templates installed on your Joomla 3+ website. This can be confusing and you may wonder why it displays positions from templates that are not the default template.

They show up in the list because some developers will use different templates for different pages on their Joomla site.

Be sure to only select position names from the template that you are using for your Joomla site. If you select one of the positions from another template, and Protostar does not have that position name, it won't appear on your site (if you are using the Protostar template).

If this is causing problems, then you can remove the unused templates using the proper steps in Template Manager.

Has BJ.Zemplate.com helped you with understanding Joomla?

If you would like to make a small contribution to help fund this resource, that would be great, but do not feel obligated in any way.

Donation Amounts

Still not finding a special topic?

Use Google's Search function below for search the content of bj.zemplate.com.