News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Mambo Users Please HELP!

Started by trenchteam, June 20, 2005, 05:53:30 AM

Previous topic - Next topic

trenchteam

I've attempted to post this for weeks in the Mambo Forums with no response. So Im asking in SMF forums even though it might not belong here. 

How can I get my left sidebar to COLLAPSE in my MAMBO LAYOUT if I choose to have no modules on the left sidebar for certain components.. Right now, I have the SMF FORUMs I cant fit it without removing the left sidebar. Problem is, even when I remove all the modules on the left side, the sidebar still appears and it is just blank, and the forums are pushed outside the layout.   I have used other Mambo themes that have a colapsing sidebar when there are not modules present. How can I accomplish this with the theme Im currently using.  I've taken alot of time to modify it to the look I want, and dont want to start over.  Anyone know how to make your sidebar  collapse if no modules are present and where to find the code that need modification?

Orstio

Something like this:

                            <?php if (mosCountModules"left" ) > 0) { ?>
                             <tr>
                              <td>
                                <?php mosLoadModules 'left' ); ?>
                              </td>
                            </tr>
                            <?php ?>


This will vary, depending on which module areas you have specified in your template, and the code (tables, divs, etc.) you have surrounding the mosLoadModules function(s).

trenchteam

Do i just add that to the coding? Where do i look? In the index?

xenovanis

In the index.php of your Mambo template, you will have to add it around the tablecells of the column you want to hide. Orstio gave you an example how to hide the leftcolumn.
"Insanity: doing the same thing over and over again and expecting different results."

trenchteam

Thanks. I think Im understanding. Gonna try this out. Wish me LUCK! ;D

xenovanis

This


<?php if (mosCountModules"left" ) > 0) { ?>


is the piece of code that actually hides the column. It will detect whether the column is empty and should not be loaded or there is content, in which case it should be loaded. You will need to put it before the start of the column <tr> and the closing <?php } ?> after the end of the column </tr>.

Do not remove

<?php mosLoadModules 'left' ); ?>


this part, this is what actually loads your content. I hope this makes any sense.
"Insanity: doing the same thing over and over again and expecting different results."

Orstio

I guess it is important to know what each of those functions does.

mosCountModules('left'); will count all the modules that are specified in Mambo as being in the template area named "left".  So:

if (mosCountModules('left')>0){

Is asking the simple question "Are there any modules in the left column?  If yes, perform the following actions."

mosLoadModules('left'); actually displays the modules that are specified in Mambo as being in the template area named "left".

xenovanis

Quote from: Orstio on June 20, 2005, 06:55:34 PM
I guess it is important to know what each of those functions does.

mosCountModules('left'); will count all the modules that are specified in Mambo as being in the template area named "left".  So:

if (mosCountModules('left')>0){

Is asking the simple question "Are there any modules in the left column?  If yes, perform the following actions."

mosLoadModules('left'); actually displays the modules that are specified in Mambo as being in the template area named "left".

That's the better way to explain it  :)
"Insanity: doing the same thing over and over again and expecting different results."

trenchteam

Well, in the index I have this is what things look like right now.

<?php if (mosCountModules('left')) { ?>
<div class="leftrow">
<?php mosLoadModules 'left' ); ?>
</div>
<?php ?>


I tried to add the <?php if (mosCountModules"left" ) > 0) { ?> in place of the moscountmod but it didnt' do anything at all?

xenovanis

Oh oh. Which template are you using? Can you post some more code?
"Insanity: doing the same thing over and over again and expecting different results."

trenchteam

Heres the Body of index.   I kinda want to keep the site under wraps, but if you want to look at it first hand, I can PM you the location. ;D

<body>
<table width="780" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td background="<?php echo $mosConfig_live_site;?>/xxxxxx/xxxxxx/images/xxxxxx" bgcolor="#444444"><?php mosLoadModules 'user3' ); ?></td>
</tr>
</table>
<table width="766" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td colspan="3">
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="11" height="25" background="<?php echo $mosConfig_live_site;?>/templates/xxxxxx/images/xxxxxx"><div>
</div></td>
<td height="25" bgcolor="#F1F1F1" style="border-bottom: 1px solid #999999; border-top: 5px solid #FFFFFF;"><?php mosPathWay(); ?></td>
<td height="25" align="right" bgcolor="#F1F1F1" style="border-bottom: 1px solid #999999; border-top: 5px solid #FFFFFF;"><div class="date"><?php echo mosCurrentDate(); ?></div></td>
<td width="11" height="25" align="right" background="<?php echo $mosConfig_live_site;?>/templates/xxxxxx/images/xxxxxx">&nbsp;</td>
</tr>
</table>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td valign="top" style="padding-left:8px; background-repeat: repeat-y;" background="<?php echo $mosConfig_live_site;?>/templates/xxxxxx/images/xxxxxxx">&nbsp;</td>
<td valign="top" style="background-repeat: repeat-y;"background="<?php echo $mosConfig_live_site;?>/templates/xxxxxxx/images/xxxxxxx"><?php if (mosCountModules('left')) { ?>
<div class="leftrow">
<?php mosLoadModules 'left' ); ?>
</div>
<?php ?>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>&nbsp;</td>
</tr>
</table>
<table width="168" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
</table></td><td valign="top" bgcolor="#FAFAFA" width="100%"><div class"main">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr valign="top" bgcolor="#F1F1F1">
<?php if (mosCountModules('top')) { ?><td style="border-top: 3px solid #FFFFFF;">
<div> <table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td valign="top"> <table width="98%" border="0" cellspacing="0" cellpadding="0">
<tr bgcolor="#FFFFFF">
<td colspan="3"> <div align="left">
<img src="<?php echo $GLOBALS['mosConfig_live_site']; ?>/templates/xxxxxxx/images/rotate/rotator.php" width="584" height="175" />
</div></td>
</tr>
<tr>
<td colspan="3" valign="top"> <table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="3" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td valign="top">&nbsp;</td>
</tr>
</table></td>
</tr>
<tr>
<td width="3" valign="top" bgcolor="#F1F1F1">&nbsp;</td>
<td width="578" valign="top" bgcolor="#F1F1F1"><?php mosLoadModules 'top' ); ?></td>
<td width="3" valign="top" bgcolor="#F1F1F1">&nbsp;</td>
</tr>
</table></td>
</tr>
<tr>
<td colspan="3" valign="top"><table width="585" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="3" valign="top" bgcolor="#ffffff">&nbsp;</td>
<td width="178" valign="top" bgcolor="#F1F1F1"><?php mosLoadModules 'user1' ); ?></td>
<td width="3" valign="top" bgcolor="#ffffff">&nbsp;</td>
<td width="222" valign="top" bgcolor="#F1F1F1"><?php mosLoadModules 'user2' ); ?></td>
</tr>
</table></td>
</tr>
<tr>
<td width="3" valign="top" bgcolor="#FFFFFF">&nbsp;</td>
<td width="578" valign="top" bgcolor="#444444"> <div align="center">
<?php mosLoadModules'banner'); ?>
</div></td>
<td width="3" valign="top" bgcolor="#FFFFFF">&nbsp;</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
</td>
<?php ?>
</tr>
<tr align="left" valign="top">
<td bgcolor="#f1f1f1" style=" border-top: 4px solid #FFFFFF; padding: 5px;"><div class="main">
<?php mosMainBody(); ?>
</div></td>
</tr>
<tr bgcolor="#F1F1F1">
<td valign="top" style="border-top: 3px solid #FFFFFF;"><?php if (mosCountModules('bottom')) { ?>
<div>
<?php mosLoadModules 'bottom' ); ?>
</div>
<?php ?></td>
</tr>
</table>
</td>
<td valign="top" style="padding-right: 8px; background-repeat: repeat-y;" background="<?php echo $mosConfig_live_site;?>/templates/xxxxxx/images/xxxxxx">&nbsp;</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="9" bgcolor="#808080">&nbsp;</td>
<td width="762" valign="top" bgcolor="#808080"><?php mosLoadModules 'user3' ); ?></td>
<td width="9" valign="top" bgcolor="#808080">&nbsp;</td>
</tr>
<tr>
<td colspan="3"><table width="100%" height="54px" border="0" cellpadding="0" cellspacing="0" bgcolor="#CCCCCC">
<tr>
   <td bgcolor="#F0F0F0"><div align="right"><span class="style14">copyright SYR Clothing Company 1999-2006</span><br><a href="http://www.7milesdown.com" target="_blank">Maintained by Trench</a> </div></td>
</tr>
</table></td>
</tr>
</table>
<p align="justify" class="style4">&nbsp;</p>
</body>

xenovanis

Did you add some rows yourself? What is this for?


<tr>
<td>&nbsp;</td>
</tr>
</table>
<table width="168" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>


Replace this:

<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td valign="top" style="padding-left:8px; background-repeat: repeat-y;" background="<?php echo $mosConfig_live_site;?>/templates/xxxxxx/images/xxxxxxx">&nbsp;</td>
<td valign="top" style="background-repeat: repeat-y;"background="<?php echo $mosConfig_live_site;?>/templates/xxxxxxx/images/xxxxxxx"><?php if (mosCountModules('left')) { ?>
<div class="leftrow">
<?php mosLoadModules 'left' ); ?>
</div>
<?php ?>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>&nbsp;</td>
</tr>


with this:


<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<?php if (mosCountModules('left')) { ?>
<tr>
<td valign="top" style="padding-left:8px; background-repeat: repeat-y;" background="<?php echo $mosConfig_live_site;?>/templates/xxxxxx/images/xxxxxxx">&nbsp;</td>
<td valign="top" style="background-repeat: repeat-y;"background="<?php echo $mosConfig_live_site;?>/templates/xxxxxxx/images/xxxxxxx">
<div class="leftrow">
<?php mosLoadModules 'left' ); ?>
</div>

<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>&nbsp;</td>
</tr>
<?php ?>
"Insanity: doing the same thing over and over again and expecting different results."

Orstio

#12
Check your Mambo admin modules menu.  Each module in the list will show in which template area they are published.

Click each module in the list that specifies the area "left", and edit the pages on which each will appear.

For some reason this:

<td valign="top" style="background-repeat: repeat-y;"background="<?php echo $mosConfig_live_site;?>/templates/xxxxxxx/images/xxxxxxx"><?php if (mosCountModules('left')) { ?>
<div class="leftrow">
<?php mosLoadModules 'left' ); ?>
</div>
<?php ?>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>&nbsp;</td>
</tr>
</table>
<table width="168" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
</table></td>


Doesn't look right.

It looks like it should be more like this:

<td valign="top" style="background-repeat: repeat-y;"background="<?php echo $mosConfig_live_site;?>/templates/xxxxxxx/images/xxxxxxx">
<?php if (mosCountModules('left')) { ?>
<div class="leftrow">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><?php mosLoadModules 'left' ); ?></td>
</tr>
</table>
<table width="168" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
</table></div><?php ?></td>


EDIT -- Xenovanis' code above is just as valid as the code I posted here.  This just goes to show that there are several ways that the same thing can be accomplished correctly in the template.  ;)

trenchteam

Okay.  The modules on the left in the admin? Edit how each will appear?  i made sure that they only show on the HOME page.  They should disappear on the rest of the links.

trenchteam

Thanks guys! that was it!  YOU guys fcuken ROCK!  no other way to say it! ;D

goldc0der

#15
Hi all:

I have the same problem (in joomla), i what to show SMF Forum on my template but without left menu.

This is my template index code:


<?php

defined
'_VALID_MOS' ) or die( 'Restricted access' );

// needed to seperate the ISO number from the language file constant _ISO

$iso explode'='_ISO );

// xml prolog

echo '<?xml version="1.0" encoding="'$iso[1] .'"?' .'>';

?>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<?php mosShowHead(); ?>

<?php

if ( $my->id ) {

initEditor();

}

$collspan_offset = ( mosCountModules'right''left' ) + mosCountModules'user2' ) ) ? 1;

//script to determine which div setup for layout to use based on module configuration

$user1 0;

$user2 0;

$colspan 0;

$right 0;

$left 0;

$banner 0;

// banner combos

//user1 combos

if ( mosCountModules'user1' ) + mosCountModules'user2' ) == 2) {

$user1 2;

$user2 2;

$colspan 3;

} elseif ( 
mosCountModules'user1' ) == ) {

$user1 1;

$colspan 1;

} elseif ( 
mosCountModules'user2' ) == ) {

$user2 1;

$colspan 1;

}

//banner based combos

if ( mosCountModules'banner' ) and ( empty( $_REQUEST['task'] ) || $_REQUEST['task'] != 'edit' ) ) {

$banner 1;

}

//right based combos

if ( mosCountModules'right' ) and ( empty( $_REQUEST['task'] ) || $_REQUEST['task'] != 'edit' ) ) {

$right 1;

}

//left based combos

if ( mosCountModules'left' ) and ( empty( $_REQUEST['task'] ) || $_REQUEST['task'] != 'edit' ) ) {

      
$left 1;

}

//top based combos

if ( mosCountModules'top' ) and ( empty( $_REQUEST['task'] ) || $_REQUEST['task'] != 'edit' ) ) {

      
$top 1;

}

?>


<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

<?php echo "<link rel=\"stylesheet\" href=\"$GLOBALS[mosConfig_live_site]/templates/$GLOBALS[cur_template]/css/template_css.css\" type=\"text/css\"/>" ?><?php echo "<link rel=\"shortcut icon\" href=\"$GLOBALS[mosConfig_live_site]/images/favicon.ico\" />" ?>

<link href="css/template_css.css" rel="stylesheet" type="text/css" />

</head>

<body>

<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">

  <tr>

    <td><div id="header"><div class="maintitle2"><img src="../home/templates/xxxxxx/images/xxxxxx.gif"></div>

        <div id="banner">

          <?php mosLoadModules"banner", -); ?>

        </div>

      </div></td>

  </tr>

  <tr>

    <td><div id="top_menu">

        <div id="top_menu_inner">

          <?php mosLoadModules 'user3' ); ?>

        </div>

      </div></td>

  </tr>

  <tr>

    <td id="content_outer" valign="top"><table  align="center" border="0" cellpadding="0" cellspacing="0" class="content_table">

        <tr valign="top">

          <?php

if ( $left ) {

   ?>


          <td><div id="left_outer">

              <div id="left_inner_float">

                <div id="left_inner">

                  <?php mosLoadModules 'left', -); ?>

                </div>

              </div>

            </div></td>

          <?php

   }

   ?>


          <td width="100%" id="content"><div>

              <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class="content">

                <tr>

                  <td colspan="<?php echo $colspan?>"><div id="pathway">

                      <div id="pathway_text">

                        <?php mosPathWay(); ?>

                      </div>

                    </div>

                    <div id="main_content">

                      <?php mosMainBody(); ?>

                    </div></td>

                </tr>

                <?php

if ($colspan 0) {

?>


                <tr valign="top">

                  <?php

   if ( $user1 ) {

   ?>


                  <td width="50%"><div id="user1_outer">

                      <div class="user1_inner">

                        <?php mosLoadModules 'user1', -); ?>

                      </div>

                    </div></td>

                  <?php

   }

   if ( $colspan == 3) {

 ?>


                  <?php

}

   if ( $user2 ) {

   ?>


                  <td width="50%"><div id="user2_outer">

                      <div class="user2_inner">

                        <?php mosLoadModules 'user2', -); ?>

                      </div>

                    </div></td>

                  <?php

   }

?>


                </tr>

                <tr>

                  <td colspan="<?php echo $colspan?>"></td>

                </tr>

                <?php

}

?>


              </table>

            </div></td>

          <?php

if ( $right ) {

   ?>


          <td><div id="right_outer">

              <div id="right_inner_float">

                <div id="right_inner">

                  <?php mosLoadModules 'right', -); ?>

                </div>

              </div>

            </div></td>

          <?php

   }

   ?>


        </tr>

      </table>

      <div align="center">

        <div id="copy">

          <div id="copy_inner" class="copy_inner">Copyright &copy; 2007 - <?php echo $mosConfig_sitename?></div>

        </div>

      </div></td>

  </tr>

</table>

<?php mosLoadModules'debug', -);?>

</body>

</html>


Any help?

Regards


-edit- Please use the code tags... not the quote tags

Kindred

did you even TRY t read the previous messages?   The <if> code is explained in those messages.

besides that, you appear to already *HAVE* the correct conditional code in your template...
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

goldc0der

Problem solved on Admin Joomla area!

Thanks and Regards

Advertisement: