| my site in 3.1 |
|
the template is protostar |
Adding positions to the template
In fact the template already contains the positions heading 4, heading 5, heading 6,
This is reflected in the description file:
templateDetails.xml
|
...
position-4 position-5 position-6 ... |
But they do not appear in the initial implementation file index.php
The aim was to add under Articles 3 headings:

Changes
Addition of 3 positions
Index.php file
<div>
<?php if ($this->countModules('position-7')):?>
<div id="aside" class="span3">
<!-- Begin Right Sidebar -->
<jdoc:include type="modules" name="position-7" style="well" />
<!-- End Right Sidebar -->
</div>
<?php endif; ?>
</div>
<!-- ajout du row pour les 3 positions -->
<div class="row-fluid">
<?php if ($this->countModules('position-4')): ?>
<!-- Begin Sidebar -->
<div id="sidebar" class="span4">
<div class="sidebar-nav">
<jdoc:include type="modules" name="position-4" style="xhtml" />
</div>
</div>
<!-- End Sidebar -->
<?php endif; ?>
<?php if ($this->countModules('position-5')): ?>
<!-- Begin Sidebar -->
<div id="sidebar" class="span4">
<div class="sidebar-nav">
<jdoc:include type="modules" name="position-5" style="xhtml" />
</div>
</div>
<!-- End Sidebar -->
<?php endif; ?>
<?php if ($this->countModules('position-6')): ?>
<!-- Begin Sidebar -->
<div id="sidebar" class="span4">
<div class="sidebar-nav">
<jdoc:include type="modules" name="position-6" style="xhtml" />
</div>
</div>
<!-- End Sidebar -->
<?php endif; ?>
</div>
<?php if ($this->countModules('position-7')):?>
<div id="aside" class="span3">
<!-- Begin Right Sidebar -->
<jdoc:include type="modules" name="position-7" style="well" />
<!-- End Right Sidebar -->
</div>
<?php endif; ?>
</div>
<!-- ajout du row pour les 3 positions -->
<div class="row-fluid">
<?php if ($this->countModules('position-4')): ?>
<!-- Begin Sidebar -->
<div id="sidebar" class="span4">
<div class="sidebar-nav">
<jdoc:include type="modules" name="position-4" style="xhtml" />
</div>
</div>
<!-- End Sidebar -->
<?php endif; ?>
<?php if ($this->countModules('position-5')): ?>
<!-- Begin Sidebar -->
<div id="sidebar" class="span4">
<div class="sidebar-nav">
<jdoc:include type="modules" name="position-5" style="xhtml" />
</div>
</div>
<!-- End Sidebar -->
<?php endif; ?>
<?php if ($this->countModules('position-6')): ?>
<!-- Begin Sidebar -->
<div id="sidebar" class="span4">
<div class="sidebar-nav">
<jdoc:include type="modules" name="position-6" style="xhtml" />
</div>
</div>
<!-- End Sidebar -->
<?php endif; ?>
</div>
Replace or delete footer content
We can then add a custom module to the position footer
Index.php file
<footer class="footer" role="contentinfo">
<div class="container<?php echo ($params->get('fluidContainer') ? '-fluid' : ''); ?>">
<hr />
<jdoc:include type="modules" name="footer" style="none" />
<!--<p class="pull-right">
<a href="#top" id="back-top">
<?php echo JText::_('TPL_PROTOSTAR_BACKTOTOP'); ?>
</a>
</p>
<p>
&copy; <?php echo date('Y'); ?> <?php echo $sitename; ?>
</p>-->
</div>
</footer>
<div class="container<?php echo ($params->get('fluidContainer') ? '-fluid' : ''); ?>">
<hr />
<jdoc:include type="modules" name="footer" style="none" />
<!--<p class="pull-right">
<a href="#top" id="back-top">
<?php echo JText::_('TPL_PROTOSTAR_BACKTOTOP'); ?>
</a>
</p>
<p>
&copy; <?php echo date('Y'); ?> <?php echo $sitename; ?>
</p>-->
</div>
</footer>
Use javascript with the latest version 3.6.x
It is possible to write a suitable code in the associated file user.js, for example here to remove the unused part of the footer
User.js file
(function($)
{
$(document).ready(function()
{
var footer = $("body footer");
if (footer) {
var pullright = footer.find(".pull-right");
if (pullright)
{
pullright.hide();
pullright.next().hide();
pullright.text("");
}
}
});
})(jQuery);
{
$(document).ready(function()
{
var footer = $("body footer");
if (footer) {
var pullright = footer.find(".pull-right");
if (pullright)
{
pullright.hide();
pullright.next().hide();
pullright.text("");
}
}
});
})(jQuery);
