Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Add link in actual logo

Add link in actual logo

Locked

Views: 2,304

Results 1 to 20 of 22
This thread is locked. New replies are disabled.
13 Dec 2008, 2:45 AM
#1
gee38l avatar

gee38l

Zen Follower

Join Date:
Jul 2008
Posts:
362
Plugin Contributions:
0

Add link in actual logo

Hey Zenners,

I have been going through threads for the past 2 days looking for a solution to what i want to do. I have tried heaps of solutions that have been posted but i cant seem to get it right!

I am trying to move a shopping cart mod from the navigation bar into the logo just below and a simple search bar newxt to it on the same line basically replacing the currencies bar with the search and moving it into the logo..... Then deleteing the entire navigation bar so that the css header menu can be used instead.

I have attached a pic!
Link: https://www.truwater.com.au

Thanks gee38l

13 Dec 2008, 5:00 AM
#2
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Add link in actual logo

I would say you are fighting a Template Monster Template issue...
As they do not design within the ZenCart structure most anything you can find here will not apply
You can search for them here are see the many issues

13 Dec 2008, 6:04 AM
#3
gee38l avatar

gee38l

Zen Follower

Join Date:
Jul 2008
Posts:
362
Plugin Contributions:
0

Re: Add link in actual logo

kobra:

I would say you are fighting a Template Monster Template issue...
As they do not design within the ZenCart structure most anything you can find here will not apply
You can search for them here are see the many issues

Yeah someone said something like that before. Although I managed to get the item in cart into the nav bar! Surely I can do what I want to do it's just I think I'm placing the code in the wrong place. Can you please assist me?
Posted via Mobile Device

13 Dec 2008, 6:29 AM
#4
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Add link in actual logo

It probably can be done; the problem is that TM versions of template files are often so different from the standard version that we don't already know from our experience how to fix them. A few people have some experience with altering TM templates, but most of us don't want anything to do with them because they are such a stupid pain. The functions TM puts in could be done neatly within the standard structure, but they choose to mangle it.

13 Dec 2008, 6:41 AM
#5
gee38l avatar

gee38l

Zen Follower

Join Date:
Jul 2008
Posts:
362
Plugin Contributions:
0

Re: Add link in actual logo

gjh42:

It probably can be done; the problem is that TM versions of template files are often so different from the standard version that we don't already know from our experience how to fix them. A few people have some experience with altering TM templates, but most of us don't want anything to do with them because they are such a stupid pain. The functions TM puts in could be done neatly within the standard structure, but they choose to mangle it.

Yeah im finding TM templates to be a pain aswell! The initial web designers implemented this and i didnt know about it until i posted a problem here in which i then found out that it can be difficult to play with as most of the solutions here dont work as the code is customised, they have since been fired and i have taken over but i am new to all this so im learning :) So far i have managed to add the css header menu and place that to how i want using tpl_header, i have also added the cart bar into the nav header and placed that correctly and now they want me to change it how i have it layed out in the picture. So what can i do to get it like the pic im sure its just a matter of having the code in the correct place but knowing where the correct place is has proven to be pain as the code in tpl header is not defined like it is with the default templates etc. Glen i know you have assisted me before with the other things above what can i do to get this done?

Thanks

17 Dec 2008, 3:48 AM
#6
gee38l avatar

gee38l

Zen Follower

Join Date:
Jul 2008
Posts:
362
Plugin Contributions:
0

Re: Add link in actual logo

Anyone?

17 Dec 2008, 4:19 AM
#7
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Add link in actual logo

Since we know the files are different from standard, there is no way anyone can help unless you post the tpl_header.php that you have, and possibly other relevant files. (Use ```
[php] and [/php]

17 Dec 2008, 5:59 AM
#8
gee38l avatar

gee38l

Zen Follower

Join Date:
Jul 2008
Posts:
362
Plugin Contributions:
0

Re: Add link in actual logo

Sorry here is the tpl_header...

<?php
/**
 * Common Template - tpl_header.php
 *
 * this file can be copied to /templates/your_template_dir/pagename<br />
 * example: to override the privacy page<br />
 * make a directory /templates/my_template/privacy<br />
 * copy /templates/templates_defaults/common/tpl_footer.php to /templates/my_template/privacy/tpl_header.php<br />
 * to override the global settings and turn off the footer un-comment the following line:<br />
 * <br />
 * $flag_disable_header = true;<br />
 *
 * @package templateSystem
 * @copyright Copyright 2003-2006 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: tpl_header.php 4813 2006-10-23 02:13:53Z drbyte $
 */
?>
<?php

	
  // Display all header alerts via messageStack:
  if ($messageStack->size('header') > 0) {
    echo $messageStack->output('header');
  }
  if (isset($_GET['error_message']) && zen_not_null($_GET['error_message'])) {
  echo htmlspecialchars(urldecode($_GET['error_message']));
  }
  if (isset($_GET['info_message']) && zen_not_null($_GET['info_message'])) {
   echo htmlspecialchars($_GET['info_message']);
} else {

}
?>


<!--bof-header logo and navigation display-->
<?php
if (!isset($flag_disable_header) || !$flag_disable_header) {
?>

	<?php
      if (SHOW_BANNERS_GROUP_SET1 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET1)) {
        if ($banner->RecordCount() > 0) {
    ?>
    
   <div id="bannerOne"><?php echo zen_display_banner('static', $banner); ?></div>
    <?php
        }
      }
    ?>
	
	<div class="menu">
		<div class="menu_r">
			<div class="menu_l">
				<div class="menu_tr">
					<div class="menu_tl">
					
						<div class="menu_pad">
							<div class="navigation">
		
            		<div class="nav_1">
            			<?php #HEADER LINKS START ?>
            					
            					<a href="<?php echo HTTP_SERVER . DIR_WS_CATALOG ?>"><?php echo HEADER_TITLE_CATALOG; ?></a>
            					
            				<?php if ($_SESSION['customer_id']) { ?>
            					 |  <a href="<?php echo zen_href_link(FILENAME_LOGOFF, '', 'SSL'); ?>"><?php echo HEADER_TITLE_LOGOFF; ?></a>
            					 |  <a href="<?php echo zen_href_link(FILENAME_ACCOUNT, '', 'SSL'); ?>"><?php echo HEADER_TITLE_MY_ACCOUNT; ?></a> 
            				<?php
            					  } else {
            						if (STORE_STATUS == '0') {
            				?>
            					 |  <a href="<?php echo zen_href_link(FILENAME_LOGIN, '', 'SSL'); ?>"><?php echo HEADER_TITLE_LOGIN; ?></a>  
            				<?php } } ?>  
            				
            				<?php if ($_SESSION['cart']->count_contents() != 0) { ?>
            					 |  <a href="<?php echo zen_href_link(FILENAME_SHOPPING_CART, '', 'NONSSL'); ?>"><?php echo HEADER_TITLE_CART_CONTENTS; ?></a>
            					 |  <a href="<?php echo zen_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'); ?>"><?php echo HEADER_TITLE_CHECKOUT; ?></a>
            				<?php } ?>
            						
            			<?php #HEADER LINKS END ?>	
            		</div>
            		
            		<div class="nav_2">
            			<?php #HEADER CURRENCIES START ?>							
                        <?=zen_draw_form('currencies', zen_href_link(basename(ereg_replace('.php','', $PHP_SELF)), '', $request_type, false), 'get')?>
            			<?php echo BOX_HEADING_CURRENCIES;?>:  

                        <?
                        
                            if (isset($currencies) && is_object($currencies)) {
                        
                              reset($currencies->currencies);
                              $currencies_array = array();
                              while (list($key, $value) = each($currencies->currencies)) {
                                $currencies_array[] = array('id' => $key, 'text' => $value['title']);
                              }
                        
                              $hidden_get_variables = '';
                              reset($_GET);
                              while (list($key, $value) = each($_GET)) {
                                if ( ($key != 'currency') && ($key != zen_session_name()) && ($key != 'x') && ($key != 'y') ) {
                                  $hidden_get_variables .= zen_draw_hidden_field($key, $value);
                                }
                              }
                            }
                        
                        ?><?=zen_draw_pull_down_menu('currency', $currencies_array, $_SESSION['currency'], 'class="select" onchange="this.form.submit();"') . $hidden_get_variables . zen_hide_session_id()?></form>
                                            
                        <?php #HEADER CURRENCIES END ?>	
            		</div>
            		
            		<div class="nav_3">
        <div id="navMainCartSummary"><?php require(DIR_WS_MODULES . 'sideboxes/cart_summary.php'); ?></div>

            		</div>
            		
            		<div class="clear"></div>
            	</div>	
								
							<div class="clear"></div>
						</div>
					
					</div>
				</div>
			</div>
		</div>
	</div>
    
    <div class="head">
		<div class="head_r">
			<div class="head_l">
			
				<div class="logo">
					<div class="spacer"><a href="<?php echo zen_href_link(FILENAME_DEFAULT);?>"><?php echo zen_image(DIR_WS_TEMPLATE.'images/logo.jpg'); ?></a></div>
				</div>
			
			</div>
		</div>
	</div>
    
    <div class="spacer"><?php echo zen_draw_separator($image = 'pixel_trans.gif', '1', '2');?></div> 
     
<!--bof-drop down menu display-->
<?php require($template->get_template_dir('tpl_drop_menu.php',DIR_WS_TEMPLATE, $current_page_base,'common'). '/tpl_drop_menu.php');?>
<!--eof-drop down menu display-->
<div class="clearBoth"></div>
              
                        
				<?php
					if (SHOW_BANNERS_GROUP_SET2 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET2)) {
                    	if ($banner->RecordCount() > 0) {
				?>
                        <div id="bannerTwo"><?php echo zen_display_banner('static', $banner);?></div>
						<div class="spacer"><?php echo zen_draw_separator($image = 'pixel_trans.gif', '1', '2');?></div> 
    			<?php
                    	}
                  	}
    			?>
                
    
<?php } ?>
17 Dec 2008, 6:35 AM
#9
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Add link in actual logo

You have this long string of divs that enclose the various nav sections:

<div class="menu"> <div class="menu_r"> <div class="menu_l"> <div class="menu_tr"> <div class="menu_tl">
                    <div class="menu_pad">
                        <div class="navigation">

It looks like .nav_1 is the part you want to eliminate. As long as you have those functions elsewhere, you can delete that section.

.nav_2 and .nav_3 are the parts you want to move into the logo area, so move those code blocks

<div class="nav_2"> <?php #HEADER CURRENCIES START ?> ... <?php #HEADER CURRENCIES END ?> </div> <div class="nav_3"> <div id="navMainCartSummary"> ... </div> </div>

into this section```php
<div class="head">
<div class="head_r">
<div class="head_l">

            <div class="logo">
                <div class="spacer"><a href="<?php echo zen_href_link(FILENAME_DEFAULT);?>"><?php echo zen_image(DIR_WS_TEMPLATE.'images/logo.jpg'); ?></a></div>
            </div>
        
        </div>
    </div>
</div> 
<div class="spacer">
line.

You will need to make that spacer not occupy the whole logo width; in stylesheet_tm.css, just after
.spacer {font-size:0px; line-height:0px;}
add
.logo .spacer {width:460px;}

Eliminate the whole mess of divs before
<div class="head">
(starting with <div class="menu"> ).

You will need to change a bunch of styles to make the nav divs look right in their new location.
17 Dec 2008, 7:06 AM
#10
gee38l avatar

gee38l

Zen Follower

Join Date:
Jul 2008
Posts:
362
Plugin Contributions:
0

Re: Add link in actual logo

Ok i have just moved the code to where you had advised and it seems to be below the logo now.....

(see pic)

Displays new position in ff and doest show anything in IE

Here is my current code:

<?php
/**
 * Common Template - tpl_header.php
 *
 * this file can be copied to /templates/your_template_dir/pagename<br />
 * example: to override the privacy page<br />
 * make a directory /templates/my_template/privacy<br />
 * copy /templates/templates_defaults/common/tpl_footer.php to /templates/my_template/privacy/tpl_header.php<br />
 * to override the global settings and turn off the footer un-comment the following line:<br />
 * <br />
 * $flag_disable_header = true;<br />
 *
 * @package templateSystem
 * @copyright Copyright 2003-2006 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: tpl_header.php 4813 2006-10-23 02:13:53Z drbyte $
 */
?>
<?php

	
  // Display all header alerts via messageStack:
  if ($messageStack->size('header') > 0) {
    echo $messageStack->output('header');
  }
  if (isset($_GET['error_message']) && zen_not_null($_GET['error_message'])) {
  echo htmlspecialchars(urldecode($_GET['error_message']));
  }
  if (isset($_GET['info_message']) && zen_not_null($_GET['info_message'])) {
   echo htmlspecialchars($_GET['info_message']);
} else {

}
?>


<!--bof-header logo and navigation display-->
<?php
if (!isset($flag_disable_header) || !$flag_disable_header) {
?>

	<?php
      if (SHOW_BANNERS_GROUP_SET1 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET1)) {
        if ($banner->RecordCount() > 0) {
    ?>
    
   <div id="bannerOne"><?php echo zen_display_banner('static', $banner); ?></div>
    <?php
        }
      }
    ?>
	
	<div class="menu">
		<div class="menu_r">
			<div class="menu_l">
				<div class="menu_tr">
					<div class="menu_tl">
					
						<div class="menu_pad">
							<div class="navigation">
		
            		<div class="nav_1">
            			<?php #HEADER LINKS START ?>
            					
            					<a href="<?php echo HTTP_SERVER . DIR_WS_CATALOG ?>"><?php echo HEADER_TITLE_CATALOG; ?></a>
            					
            				<?php if ($_SESSION['customer_id']) { ?>
            					 |  <a href="<?php echo zen_href_link(FILENAME_LOGOFF, '', 'SSL'); ?>"><?php echo HEADER_TITLE_LOGOFF; ?></a>
            					 |  <a href="<?php echo zen_href_link(FILENAME_ACCOUNT, '', 'SSL'); ?>"><?php echo HEADER_TITLE_MY_ACCOUNT; ?></a> 
            				<?php
            					  } else {
            						if (STORE_STATUS == '0') {
            				?>
            					 |  <a href="<?php echo zen_href_link(FILENAME_LOGIN, '', 'SSL'); ?>"><?php echo HEADER_TITLE_LOGIN; ?></a>  
            				<?php } } ?>  
            				
            				<?php if ($_SESSION['cart']->count_contents() != 0) { ?>
            					 |  <a href="<?php echo zen_href_link(FILENAME_SHOPPING_CART, '', 'NONSSL'); ?>"><?php echo HEADER_TITLE_CART_CONTENTS; ?></a>
            					 |  <a href="<?php echo zen_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'); ?>"><?php echo HEADER_TITLE_CHECKOUT; ?></a>
            				<?php } ?>
            						
            			<?php #HEADER LINKS END ?>	
            		</div>
            		
            		
            		
            		<div class="clear"></div>
            	</div>	
								
							<div class="clear"></div>
						</div>
					
					</div>
				</div>
			</div>
		</div>
	</div>
    
    <div class="head">
		<div class="head_r">
			<div class="head_l">
			
				<div class="logo">
					<div class="spacer"><a href="<?php echo zen_href_link(FILENAME_DEFAULT);?>"><?php echo zen_image(DIR_WS_TEMPLATE.'images/logo.jpg'); ?></a></div>
<div class="nav_2">
            			<?php #HEADER CURRENCIES START ?>							
                        <?=zen_draw_form('currencies', zen_href_link(basename(ereg_replace('.php','', $PHP_SELF)), '', $request_type, false), 'get')?>
            			<?php echo BOX_HEADING_CURRENCIES;?>:  

                        <?
                        
                            if (isset($currencies) && is_object($currencies)) {
                        
                              reset($currencies->currencies);
                              $currencies_array = array();
                              while (list($key, $value) = each($currencies->currencies)) {
                                $currencies_array[] = array('id' => $key, 'text' => $value['title']);
                              }
                        
                              $hidden_get_variables = '';
                              reset($_GET);
                              while (list($key, $value) = each($_GET)) {
                                if ( ($key != 'currency') && ($key != zen_session_name()) && ($key != 'x') && ($key != 'y') ) {
                                  $hidden_get_variables .= zen_draw_hidden_field($key, $value);
                                }
                              }
                            }
                        
                        ?><?=zen_draw_pull_down_menu('currency', $currencies_array, $_SESSION['currency'], 'class="select" onchange="this.form.submit();"') . $hidden_get_variables . zen_hide_session_id()?></form>
                                            
                        <?php #HEADER CURRENCIES END ?>	
            		</div>
	<div class="nav_3">
        <div id="navMainCartSummary"><?php require(DIR_WS_MODULES . 'sideboxes/cart_summary.php'); ?></div>

            		</div>
				</div>
			
			</div>
		</div>
	</div>
    
    <div class="spacer"><?php echo zen_draw_separator($image = 'pixel_trans.gif', '1', '2');?></div> 
     
<!--bof-drop down menu display-->
<?php require($template->get_template_dir('tpl_drop_menu.php',DIR_WS_TEMPLATE, $current_page_base,'common'). '/tpl_drop_menu.php');?>
<!--eof-drop down menu display-->
<div class="clearBoth"></div>
              
                        
				<?php
					if (SHOW_BANNERS_GROUP_SET2 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET2)) {
                    	if ($banner->RecordCount() > 0) {
				?>
                        <div id="bannerTwo"><?php echo zen_display_banner('static', $banner);?></div>
						<div class="spacer"><?php echo zen_draw_separator($image = 'pixel_trans.gif', '1', '2');?></div> 
    			<?php
                    	}
                  	}
    			?>
                
    
<?php } ?>
17 Dec 2008, 7:28 AM
#11
gee38l avatar

gee38l

Zen Follower

Join Date:
Jul 2008
Posts:
362
Plugin Contributions:
0

Re: Add link in actual logo

Ok i did a bit of playing around and seem to have a few issues...

In firefox the position of the cart summary and currencies seems to be in the correct place but this has pushed the css flyout header down to below the logo....

In Internet explorer the position of the cart summary and currencies is spaced and not in the correct place but the css flyout header menu is in the correct place....

17 Dec 2008, 12:30 PM
#12
gee38l avatar

gee38l

Zen Follower

Join Date:
Jul 2008
Posts:
362
Plugin Contributions:
0

Re: Add link in actual logo

OK in regards to the above issues i think i have fixed them...
The only problem left is safari it is displaying the cart contents above the logo.... In which i want to remove the navigation bar...

So does anyone have any advice on how to completely remove the navigation bar and position the cart contents in safari similar to ff and ie?

(Also i have searched the forums and followed a few tutorials on removing the navigation bar but the only one that seems to work is the .navigation {display:none} but this leaved a gap in ie but looks fine in ff and safari)

Any help greatly appreciated :)

18 Dec 2008, 7:45 AM
#13
gee38l avatar

gee38l

Zen Follower

Join Date:
Jul 2008
Posts:
362
Plugin Contributions:
0

Re: Add link in actual logo

Anyone?

18 Dec 2008, 9:57 AM
#14
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Add link in actual logo

"Eliminate the whole mess of divs before

<div class="head"> (starting with <div class="menu"> )."

Did you miss this in my post above?

18 Dec 2008, 12:10 PM
#15
gee38l avatar

gee38l

Zen Follower

Join Date:
Jul 2008
Posts:
362
Plugin Contributions:
0

Re: Add link in actual logo

gjh42:

"Eliminate the whole mess of divs before

<div class="head"> (starting with <div class="menu"> )."

Did you miss this in my post above?

Sorry i missed that part!

Anyway i deleted the following for tpl_header:

	<div class="menu">
		<div class="menu_r">
			<div class="menu_l">
				<div class="menu_tr">
					<div class="menu_tl">
					
						<div class="menu_pad">

It removes the navigation bar but leaves a gap and stretches the entire web page to fit the screen

19 Dec 2008, 12:30 AM
#16
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Add link in actual logo

If you deleted only what you show above, you left a bunch of hanging </div> and other code. You need to delete all of this before <div class="head"> (including the parts in there that don't show up in view source)```php

<div class="menu">
	<div class="menu_r">
		<div class="menu_l">
			<div class="menu_tr">
				<div class="menu_tl">
				
					<div class="menu_pad">

						<div class="navigation">
	
        		<div class="nav_1">
        			            					
        					<a href="http://www.truwater.com.au/">Home</a>
        					
        				            					 |  <a href="https://www.truwater.com.au/index.php?main_page=login">Log In</a>  
        				  
        				
        				            						
        				
        		</div>
        		
        		
        		
        		<div class="clear"></div>
        	</div>	
							
						<div class="clear"></div>

					</div>
				
				</div>
			</div>
		</div>
	</div>
</div>

<div class="head">
19 Dec 2008, 1:24 AM
#17
gee38l avatar

gee38l

Zen Follower

Join Date:
Jul 2008
Posts:
362
Plugin Contributions:
0

Re: Add link in actual logo

gjh42:

If you deleted only what you show above, you left a bunch of hanging </div> and other code. You need to delete all of this before <div class="head"> (including the parts in there that don't show up in view source)```php

<div class="menu">
	<div class="menu_r">
		<div class="menu_l">
			<div class="menu_tr">
				<div class="menu_tl">
				
					<div class="menu_pad">

						<div class="navigation">
	
        		<div class="nav_1">
        			            					
        					<a href="http://www.truwater.com.au/">Home</a>
        					
        				            					 |  <a href="https://www.truwater.com.au/index.php?main_page=login">Log In</a>  
        				  
        				
        				            						
        				
        		</div>
        		
        		
        		
        		<div class="clear"></div>
        	</div>	
							
						<div class="clear"></div>

					</div>
				
				</div>
			</div>
		</div>
	</div>
</div>

<div class="head">

Thanks Glenn!
I think that has done it.... I have tested in ff and ie6 on linux dont have access to ie7 or safari at work. If anyone can test on safari, ie7 and ff on a windows machine that will be great!
19 Dec 2008, 1:46 AM
#18
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Add link in actual logo

19 Dec 2008, 2:49 AM
#19
gee38l avatar

gee38l

Zen Follower

Join Date:
Jul 2008
Posts:
362
Plugin Contributions:
0

Re: Add link in actual logo

kobra:

Try this
http://browsershots.org/

Perfect exactly what i need!

I just noticed that on safari my cart summary on the top right hand corner has dissapeared

19 Dec 2008, 11:39 AM
#20
gee38l avatar

gee38l

Zen Follower

Join Date:
Jul 2008
Posts:
362
Plugin Contributions:
0

Re: Add link in actual logo

Also just had a look and it seems ie is cutting the top off the logo maybe 1 or 2 px's but looks fine in ff