Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

remove rhs column on all but home page URL supplied

Posted on 2010-08-25
10
Medium Priority
?
458 Views
Last Modified: 2013-12-13
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
Comment
Question by:TonyCabone
10 Comments
 
LVL 3

Expert Comment

by:tyronenoel
ID: 33528772
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
 
LVL 7

Expert Comment

by:rashgang
ID: 33529766
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
 

Author Comment

by:TonyCabone
ID: 33538211
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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 8

Expert Comment

by:Jesse Matlock
ID: 33558267
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
 

Author Comment

by:TonyCabone
ID: 33563963
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
 
LVL 8

Expert Comment

by:Jesse Matlock
ID: 33564033
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
 
LVL 8

Expert Comment

by:Jesse Matlock
ID: 33564046
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
 
LVL 8

Accepted Solution

by:
Jesse Matlock earned 2000 total points
ID: 33564058
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
 

Author Closing Comment

by:TonyCabone
ID: 33576033
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
 
LVL 8

Expert Comment

by:Jesse Matlock
ID: 33576047
Nice.. glad it worked out good for you Tony ;)
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Suggested Courses

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question