Joomla! Discussion Forums



It is currently Thu Nov 26, 2009 10:09 am (All times are UTC )

 




Post new topic Reply to topic  [ 1 post ] 
Author Message
Posted: Sat Dec 16, 2006 10:15 pm 
User avatar
Joomla! Virtuoso
Joomla! Virtuoso
Offline

Joined: Sun Aug 21, 2005 2:25 pm
Posts: 4103
Location: Somewhere Near Here
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:  -1
Strips all surrounding code from the module.

switch: -2
Puts the module's title in a h3, and wraps the entire thing in a


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 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 corners


Code:
<?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.

Top
  E-mail  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

Quick reply

 



Who is online

Users browsing this forum: No registered users and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group