Solved

remove rhs column on all but home page URL supplied

Posted on 2010-08-25
10
449 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
 
LVL 8

Expert Comment

by:cloud9manager
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
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
LVL 8

Expert Comment

by:cloud9manager
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:cloud9manager
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:
cloud9manager earned 500 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:cloud9manager
ID: 33576047
Nice.. glad it worked out good for you Tony ;)
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Wordpress syntax error 1 29
mysql left join sentence 7 22
Setting Up Local Lan Web Server 1 18
Adding through query php 9 13
Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to count occurrences of each item in an array.

744 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now