What are module "switches" or those funny looking negative numbers in mosLoadModules statements?
There are three "switches" that you can use to change the way modules are displayed.
switch: -1Strips all surrounding code from the module.
switch: -2Puts the module's title in a h3, and wraps the entire thing in a
switch: -3Puts the module's title in a h3, and ads several layers of divs that can be used to apply CSS techniques with rounded corners
This is how you apply the switches:
switch: -1
Strips all surrounding code from the module. Code:
<?php mosLoadModules ( 'user1', -1 ); ?>
The outputted html code looks like this:
Code:
<div class="user1_inner">
<ul class="latestnews">
<li class="latestnews">
<a href="http://localhost/projects/1112rc2/index.php?option=com_content&task=view&id=3&Itemid=9" class="latestnews">
Newsflash 2
</a>
</li>
<li class="latestnews">
<a href="http://localhost/projects/1112rc2/index.php?option=com_content&task=view&id=4&Itemid=9" class="latestnews">
Newsflash 3
</a>
</li>
<li class="latestnews">
<a href="http://localhost/projects/1112rc2/index.php?option=com_content&task=view&id=2&Itemid=9" class="latestnews">
Newsflash 1
</a>
</li>
<li class="latestnews">
<a href="http://localhost/projects/1112rc2/index.php?option=com_content&task=view&id=9&Itemid=2" class="latestnews">
Example News Item 4
</a>
</li>
<li class="latestnews">
<a href="http://localhost/projects/1112rc2/index.php?option=com_content&task=view&id=7&Itemid=2" class="latestnews">
Example News Item 2
</a>
</li>
</ul>
</div>
switch: -2
Puts the module's title in a h3, and wraps the entire thing in a Code:
<?php mosLoadModules ( 'user1', -2 ); ?>
The outputted html code looks like this:
Code:
<div class="moduletable">
<h3>
Latest News
</h3>
<ul class="latestnews">
<li class="latestnews">
<a href="http://localhost/projects/1112rc2/index.php?option=com_content&task=view&id=4&Itemid=9" class="latestnews">
Newsflash 3
</a>
</li>
<li class="latestnews">
<a href="http://localhost/projects/1112rc2/index.php?option=com_content&task=view&id=2&Itemid=9" class="latestnews">
Newsflash 1
</a>
</li>
<li class="latestnews">
<a href="http://localhost/projects/1112rc2/index.php?option=com_content&task=view&id=3&Itemid=9" class="latestnews">
Newsflash 2
</a>
</li>
<li class="latestnews">
<a href="http://localhost/projects/1112rc2/index.php?option=com_content&task=view&id=6&Itemid=2" class="latestnews">
Example News Item 1
</a>
</li>
<li class="latestnews">
<a href="http://localhost/projects/1112rc2/index.php?option=com_content&task=view&id=9&Itemid=2" class="latestnews">
Example News Item 4
</a>
</li>
</ul>
</div>
switch: -3
Puts the module's title in a h3, and ads several layers of divs that can be used to apply CSS techniques with rounded cornersCode:
<?php mosLoadModules ( 'user1', -3 ); ?>
The outputted code looks like this:
Code:
<div class="module">
<div>
<div>
<div>
<h3>
Latest News
</h3>
<ul class="latestnews">
<li class="latestnews">
<a href="http://localhost/projects/1112rc2/index.php?option=com_content&task=view&id=4&Itemid=9" class="latestnews">
Newsflash 3
</a>
</li>
<li class="latestnews">
<a href="http://localhost/projects/1112rc2/index.php?option=com_content&task=view&id=2&Itemid=9" class="latestnews">
Newsflash 1
</a>
</li>
<li class="latestnews">
<a href="http://localhost/projects/1112rc2/index.php?option=com_content&task=view&id=3&Itemid=9" class="latestnews">
Newsflash 2
</a>
</li>
<li class="latestnews">
<a href="http://localhost/projects/1112rc2/index.php?option=com_content&task=view&id=6&Itemid=2" class="latestnews">
Example News Item 1
</a>
</li>
<li class="latestnews">
<a href="http://localhost/projects/1112rc2/index.php?option=com_content&task=view&id=9&Itemid=2" class="latestnews">
Example News Item 4
</a>
</li>
</ul>
</div>
</div>
</div>
</div>
If there is no switch at all:Code:
<?php mosLoadModules ( 'user1'); ?>
The outputted code looks like this:
Code:
<table class="moduletable" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<th valign="top">
Latest News
</th>
</tr>
<tr>
<td>
<ul class="latestnews">
<li class="latestnews">
<a href="http://localhost/projects/1112rc2/index.php?option=com_content&task=view&id=4&Itemid=9" class="latestnews">
Newsflash 3
</a>
</li>
<li class="latestnews">
<a href="http://localhost/projects/1112rc2/index.php?option=com_content&task=view&id=2&Itemid=9" class="latestnews">
Newsflash 1
</a>
</li>
<li class="latestnews">
<a href="http://localhost/projects/1112rc2/index.php?option=com_content&task=view&id=3&Itemid=9" class="latestnews">
Newsflash 2
</a>
</li>
<li class="latestnews">
<a href="http://localhost/projects/1112rc2/index.php?option=com_content&task=view&id=6&Itemid=2" class="latestnews">
Example News Item 1
</a>
</li>
<li class="latestnews">
<a href="http://localhost/projects/1112rc2/index.php?option=com_content&task=view&id=9&Itemid=2" class="latestnews">
Example News Item 4
</a>
</li>
</ul>
</td>
</tr>
</tbody>
</table>
See the pictures to see how each looks. The default rhuk_solarflare_ii template was used to show the examples.
(Please note: This applies only to modules. You can't use switches on mosMainBody.)
You do not have the required permissions to view the files attached to this post.
_________________
Love good music, especially the blues? http://www.jennifermarriott.com
Need a Joomla Consultant? http://www.marpomultimedia.com
JOOMLA ROCKS
Last edited by Jenny on Tue May 01, 2007 4:46 pm, edited 1 time in total.