[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 460
  • Last Modified:

remove rhs column on all but home page URL supplied

I use the RHS column on my front page but not on any other page, but the RHS column pops up even though it's empty:

http://gator967.hostgator.com/~tekspec/vasarelli/index.php?option=com_content&view=article&id=55&Itemid=47

how can I remove this but keep them in use on the homepage?
0
TonyCabone
Asked:
TonyCabone
1 Solution
 
tyronenoelCommented:
you would have to create 2 seperate themes, one with a rhs column and one without, you then need to assign them to the different pages
0
 
rashgangCommented:
HI
Use countmodule and check the menu assignment for right side modules.:
Please see the below code

For example:
  <?php if($this->countModules('right')) : ?>
                 <td width="10" valign="bottom" class="rightShadow"></td>
                 <td width="150" valign="top"><jdoc:include type="modules" name="right" /></td>            
                  <?php endif; ?>       

Please post your index page code
0
 
TonyCaboneAuthor Commented:
Sure can, see attached.
<?php
/**
 * @copyright	Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
 * @license		GNU/GPL, see LICENSE.php
 * Joomla! is free software. This version may have been modified pursuant
 * to the GNU General Public License, and as distributed it includes or
 * is derivative of works licensed under the GNU General Public License or
 * other free or open source software licenses.
 * See COPYRIGHT.php for copyright notices and details.
 */

// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );
?>
<!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" xml:lang="<?php echo $this->language; ?>" lang="<?php echo $this->language; ?>" >
<head>
<jdoc:include type="head" />

<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/system/css/system.css" type="text/css" />
<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/system/css/general.css" type="text/css" />
<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/rhuk_milkyway/css/template.css" type="text/css" />
<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/rhuk_milkyway/css/<?php echo $this->params->get('colorVariation'); ?>.css" type="text/css" />
<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/rhuk_milkyway/css/<?php echo $this->params->get('backgroundVariation'); ?>_bg.css" type="text/css" />
<!--[if lte IE 6]>
<link href="<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/css/ieonly.css" rel="stylesheet" type="text/css" />
<![endif]-->
<?php if($this->direction == 'rtl') : ?>
	<link href="<?php echo $this->baseurl ?>/templates/rhuk_milkyway/css/template_rtl.css" rel="stylesheet" type="text/css" />
<?php endif; ?>

</head>
<body id="page_bg" class="color_<?php echo $this->params->get('colorVariation'); ?> bg_<?php echo $this->params->get('backgroundVariation'); ?> width_<?php echo $this->params->get('widthStyle'); ?>">
<a name="up" id="up"></a>
<div class="center" align="center">
	<div id="wrapper">
		<div id="wrapper_r">
			<div id="header">
				<div id="header_l">
					<div id="header_r">
						<div id="logo"></div>
						<jdoc:include type="modules" name="top" />
                      
					</div>
				</div>
			</div>
<jdoc:include type="modules" name="smallmenu" />
<jdoc:include type="modules" name="flash" />
			<div id="tabarea">
				<div id="tabarea_l">
					<div id="tabarea_r">
						<div id="tabmenu">  
					<!-- 	REMOVED 10-AUG-2010 BY TEKSPEC
                    <table cellpadding="0" cellspacing="0" class="pill">
							<tr>
								<td class="pill_l">&nbsp;</td>
								<td class="pill_m">
								<div id="pillmenu">
									<jdoc:include type="modules" name="user3" />
								</div>
								</td>
								<td class="pill_r">&nbsp;</td>
							</tr>
							</table>  -->
						</div>
					</div>
			  </div>
		  </div>

			<div id="search">
				<jdoc:include type="modules" name="user4" />
			</div>

			<div id="pathway">
				<jdoc:include type="modules" name="breadcrumb" />
			</div>

			<div class="clr"></div>

			<div id="whitebox">
				<div id="whitebox_t">
					<div id="whitebox_tl">
						<div id="whitebox_tr"></div>
					</div>
				</div>

				<div id="whitebox_m">
					<div id="area">
									<jdoc:include type="message" />

						<div id="leftcolumn">
						<?php if($this->countModules('left')) : ?>
							<jdoc:include type="modules" name="left" style="rounded" />
						<?php endif; ?>
						</div>

						<?php if($this->countModules('left')) : ?>
						<div id="maincolumn">
						<?php else: ?>
						<div id="maincolumn_full">
						<?php endif; ?>
							<?php if($this->countModules('user1 or user2')) : ?>
								<table class="nopad user1user2">
									<tr valign="top">
										<?php if($this->countModules('user1')) : ?>
											<td>
												<jdoc:include type="modules" name="user1" style="xhtml" />
											</td>
										<?php endif; ?>
										<?php if($this->countModules('user1 and user2')) : ?>
											<td class="greyline">&nbsp;</td>
										<?php endif; ?>
										<?php if($this->countModules('user2')) : ?>
											<td>
												<jdoc:include type="modules" name="user2" style="xhtml" />
											</td>
										<?php endif; ?>
									</tr>
								</table>

								<div id="maindivider"></div>
							<?php endif; ?>

							<table class="nopad">
								<tr valign="top">
									<td>
										<jdoc:include type="component" />
										<jdoc:include type="modules" name="footer" style="xhtml"/>
									</td>
									<?php if($this->countModules('right') and JRequest::getCmd('layout') != 'form') : ?>
										<td class="greyline">&nbsp;</td>
										<td width="170">
											<jdoc:include type="modules" name="right" style="xhtml"/>
										</td>
									<?php endif; ?>
								</tr>
							</table>

						</div>
						<div class="clr"></div>
					</div>
					<div class="clr"></div>
				</div>

				<div id="whitebox_b">
					<div id="whitebox_bl">
						<div id="whitebox_br"></div>
					</div>
				</div>
			</div>

			<div id="footerspacer"></div>
		</div>

		<div id="footer">
			<div id="footer_l">
			<div id="footer_r">
					<p id="syndicate">
						<jdoc:include type="modules" name="syndicate" />
                        &copy; <? echo date("Y"); ?> Vasarelli Cellar Door &amp; Cafe. All rights reserved.
					</p>
					<p id="power_by">
	 				 	<?php echo JText::_('<a href="" target="_blank">Website by</a>') ?>  

						<?php echo JText::_('Valid') ?> <a href="http://validator.w3.org/check/referer">XHTML</a> <?php echo JText::_('and') ?> <a href="http://jigsaw.w3.org/css-validator/check/referer">CSS</a>.
					</p>
			  </div>
			</div>
		</div>
	</div>
</div>
<jdoc:include type="modules" name="debug" />

</body>
</html>

Open in new window

0
[Webinar] Improve your customer journey

A positive customer journey is important in attracting and retaining business. To improve this experience, you can use Google Maps APIs to increase checkout conversions, boost user engagement, and optimize order fulfillment. Learn how in this webinar presented by Dito.

 
Jesse MatlockUX EngineerCommented:
I would HIGHLY recommend using a div based template and get away from using Tables for anything other than tabular layouts, which is what they are meant for. Once you have a div based template, modifying the layout is usually as simple as changing a few lines of CSS and possibly making a small change to the HTML.. but, it is MUCH more simple than dealing with Tables.. in the end, it will make your life much easier ;)
0
 
TonyCaboneAuthor Commented:
Hi Cloud 9,

Sounds good, I've simply run with the default rhuk_milkyway template & edited to achieve this result. Is that why there are tables in the template?

Could you assist me with the code to convert my template?

Max points up for grabs.

Cheers,
T
0
 
Jesse MatlockUX EngineerCommented:
Hi Tony,
Yes, the default milkyway template is laden with tables.. its a pretty old template. If you want to remain using that template, the best thing to do is this:
1) Go to your templates directory and copy the rhuk_milkyway folder and rename to something you will easily remember does not have the RHS column.. You should now have 2 identical rhuk_milkyway templates in that directory.. obviously with different names.
   1a) To rename the template you also need to open the templateDetails.xml file and change the name between the <name> tags. Save the file.

2) Open the index.php file in that newly copied template directory and find this code and remove it (should be close to line 107 thru 114):
<?php if($this->countModules('user1 and user2')) : ?>
      <td class="greyline">&nbsp;</td>
<?php endif; ?>
<?php if($this->countModules('user2')) : ?>
      <td>
            <jdoc:include type="modules" name="user2" style="xhtml" />
      </td>
<?php endif; ?>

3) Save the index.php file and then go to your Admin templates page.. you can then assign this new template to the menu pages you want to use it on.. ;)

Let me know if you have any issues..
0
 
Jesse MatlockUX EngineerCommented:
Tony, as a side note.. and as you can see from the code you will be removing from that template.. you will NO LONGER have the user2 module position available in the new template ;)

There is one other way to do this.. which will allow you to use the same template on the entire site.. basically, you can show/hide that same section of code, based on the ID of the menu item being rendered.
To ensure we are using the correct ID, open your current templates index.php file and add this line:
<php echo $_REQUEST['Itemid']; ?>

 just under this line:
<jdoc:include type="modules" name="left" style="rounded" />

Now, refresh your home page and reply here with the NUMBER that you see below your menu on the left ;)
0
 
Jesse MatlockUX EngineerCommented:
Actually, I'll just post the basic code here,.. and you can use it to replace the same lines you would have otherwise removed (lines 107-114 or so).. Note there are extra lines above and below, which creates another IF statement.. all this does, is check to see IF the page item ID is what you change it to.. IF it is, it shows the right column.. IF it is not.. it doesn't ;)

<?php  // be sure to change Itemid below to ID you see on your home page - leaving the single quotes
 if($_REQUEST['Itemid'] == '1' ) :
?>

      <?php if($this->countModules('user1 and user2')) : ?>
            <td class="greyline">&nbsp;</td>
      <?php endif; ?>
      <?php if($this->countModules('user2')) : ?>
            <td>
                  <jdoc:include type="modules" name="user2" style="xhtml" />
            </td>
      <?php endif; ?>

<?php endif; ?><!-- END IF -->
0
 
TonyCaboneAuthor Commented:
Thanks once again cloud9, here is the code where I actually made the IF condition:


                                          <?php endif; ?>

                                          
                                                
                                                      
                                                            
                                                            
                                                      
                                                      <?php  if($_REQUEST['Itemid'] == '2' ) :?>
                                                      <?php if($this->countModules('right') and JRequest::getCmd('layout') != 'form') : ?>
                                                            &nbsp;
                                                            
                                                                  
                                                            
                                        <?php endif; ?>
                                                      <?php endif; ?>
                                                
                                          

                                    
0
 
Jesse MatlockUX EngineerCommented:
Nice.. glad it worked out good for you Tony ;)
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now