If this is your first visit, check our documentation. To post, register or login.

Template html help

Started by phiblack on 22 Dec 2011, 9:42 AM · Views: 2,840

Results 1 to 10 of 10
22 Dec 2011, 9:42 AM
#1
phiblack avatar

phiblack

New Zenner

Join Date:
Jun 2009
Posts:
37
Plugin Contributions:
0

Post #1 by phiblack

Hello all,

I have a small problem (which I know will be an easy fix for the gurus).

I am using a template which is great but one small thing is bugging me.

The bar that sits under the main photo has all the links left hand justified rather than centred.

My website can be viewed at: https://www.colourpatch.com.au to see what I mean.

I managed to find the relevant file where the code is located (posted below).

Can someone advise what I need to change to centralise the links?

Thanks in advance,

Phil

.....

<?php /** * Template designed by 12leaves.com * 12leaves.com - Free ecommerce templates and design services * * @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: index.php 6550 2007-07-05 03:54:54Z drbyte $ */ ?> <div id="top_nav"> <div id="tab_nav"> <ul class="list-style-none"> <li class="home-link"><a href="<?php echo '' . HTTP_SERVER . DIR_WS_CATALOG;?>"><?php echo TOP_MENU_HOME;?></a></li> <?php if ($current_page_base == 'products_new') { $active = 'tab_active'; } else { $active = ''; }?>
	<li class="<?php echo $active;?>"><a href="index.php?main_page=products_new"><?php echo TOP_MENU_NEW_PRODUCTS;?></a></li>
<?php if ($current_page_base == 'specials') { $active = 'tab_active'; } else { $active = ''; }?>
	<li class="<?php echo $active;?>"><a href="index.php?main_page=specials"><?php echo TOP_MENU_SPECIALS;?></a></li>
<?php if ($current_page_base == 'featured_products') { $active = 'tab_active'; } else { $active = ''; }?>
	<li class="<?php echo $active;?>"><a href="index.php?main_page=featured_products"><?php echo TOP_MENU_FEATURED_PRODUCTS;?></a></li>
<?php if ($current_page_base == 'postage_options') { $active = 'tab_active'; } else { $active = ''; }?>
	<li class="<?php echo $active;?>"><a href="index.php?main_page=index&cPath=45"><?php echo postage_options;?></a></li>
<?php if ($current_page_base == 'account' || $current_page_base == 'login' || $current_page_base == 'account_edit' || $current_page_base == 'address_book' || $current_page_base == 'account_password' || $current_page_base == 'account_newsletters' || $current_page_base == 'account_notifications') { $active = 'tab_active'; } else { $active = ''; }?>
	<li class="<?php echo $active;?>"><a href="<?php echo zen_href_link(FILENAME_ACCOUNT, '', 'SSL'); ?>"><?php echo TOP_MENU_MY_ACCOUNT;?></a></li>
<?php if ($current_page_base == 'shopping_cart') { $active = 'tab_active'; } else { $active = ''; }?>
	<li class="<?php echo $active;?>"><a href="<?php echo zen_href_link(FILENAME_SHOPPING_CART, '', 'NONSSL'); ?>"><?php echo TOP_MENU_VIEW_CART;?></a></li>
</ul>
</div> <!-- Languages/currency -->
	<div class="languages-wrapper float-right">
<?php $languges_object = new language; if (count ($languges_object->catalog_languages) > 1){ ?>
        <div class="languages float-right">
			
            <?php require($template->get_template_dir('tpl_languages_header.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_languages_header.php'); ?>

            <div id="langPopup" class="popup popup-win hidden">
            <img class="close-pic float-right" src="<?php echo ($template->get_template_dir('', DIR_WS_TEMPLATE, $current_page_base,'images'). '/close_pic.gif'); ?>" alt="close" />
				<?php require(DIR_WS_MODULES . zen_get_module_directory('header_languages.php')); ?>
            </div>
            </div>
<?php } ?> <?php if (isset($currencies) && is_object($currencies) && count ($currencies->currencies) > 1){ ?>
			<div class="currency float-right">
            <?php require($template->get_template_dir('tpl_currency_header.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_currency_header.php'); ?>
            
            <div id="currPopup" class="popup popup-win hidden">
            <img id="close-pic" class="close-pic float-right" src="<?php echo ($template->get_template_dir('', DIR_WS_TEMPLATE, $current_page_base,'images'). '/close_pic.gif'); ?>" alt="close" />
              <ul class="list-popup">
                <?php foreach ($currencies_array_popup as $k=>$v) { ?>
22 Dec 2011, 10:37 AM
#2
stevesh avatar

stevesh

Black Belt

Join Date:
Feb 2005
Location:
Lansing, Michigan USA
Posts:
19,793
Plugin Contributions:
2

Post #2 by stevesh

You should be able to add something like this in stylesheet.css:

#tab_nav li {
float: left;
border-right: 1px solid #5e5e5e;
padding: 0 0 0 5px;
margin-left: .7em
}

22 Dec 2011, 10:21 PM
#3
phiblack avatar

phiblack

New Zenner

Join Date:
Jun 2009
Posts:
37
Plugin Contributions:
0

Post #3 by phiblack

Thanks Stevesh.

Will give it a try and see how it goes.

Phil

22 Dec 2011, 10:49 PM
#4
phiblack avatar

phiblack

New Zenner

Join Date:
Jun 2009
Posts:
37
Plugin Contributions:
0

Post #4 by phiblack

Stevesh,

Worked a treat!
(Though I bumped it upto 1.5 and it centred beautifully).

I have uncovered another 'irk' in the code.

I added a new link: 'postage options' to the bar. However if I compose the code the same as the one above it (Featured Products) for example the resulting display is 'TOP_MENU_POSTAGE_OPTIONS'?
AS you can see from below I got it to work, but it displays now as Postage_Options (which works but doesn't look as neat.

What have I screwed up??

Phil

<?php if ($current_page_base == 'featured_products') { $active = 'tab_active'; } else { $active = ''; }?> <li class="<?php echo $active;?>"><a href="index.php?main_page=featured_products"><?php echo TOP_MENU_FEATURED_PRODUCTS;?></a></li> <?php if ($current_page_base == 'postage_options') { $active = 'tab_active'; } else { $active = ''; }?> <li class="<?php echo $active;?>"><a href="index.php?main_page=index&cPath=45"><?php echo postage_options;?></a></li>
23 Dec 2011, 12:46 AM
#5
rescoccc avatar

rescoccc

Totally Zenned

Join Date:
May 2010
Location:
WA State
Posts:
1,700
Plugin Contributions:
2

Post #5 by rescoccc

Download includes/languages/english/your_template/header.php. Open it and find this section:

// top navigation menu text

Add this:

define('TOP_MENU_POSTAGE_OPTIONS', 'Postage Options');

Save it and re-upload it. Note: Backup the original first.

The best way to learn is to try stuff. But, back it up first.

23 Dec 2011, 1:31 AM
#6
phiblack avatar

phiblack

New Zenner

Join Date:
Jun 2009
Posts:
37
Plugin Contributions:
0

Post #6 by phiblack

Perfect!!

Thanks very much..

Phil

23 Dec 2011, 11:25 AM
#7
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Post #7 by schoolboy

We've used this template as well, and it does not validate at W3, because of the empty** } else { $active = '';** condition.

And as this strips in an ID, you will need to create a unique ID for every instance where it is empty...

EG:
} else { $active = 'tab_not_active_1';
} else { $active = 'tab_not_active_2';
} else { $active = 'tab_not_active_3';
} else { $active = 'tab_not_active_4'; ...etc

Then it should validate OK.

(You cannot declare an ID... then leave it blank.)

20 years a Zencart User

23 Dec 2011, 12:26 PM
#8
phiblack avatar

phiblack

New Zenner

Join Date:
Jun 2009
Posts:
37
Plugin Contributions:
0

Post #8 by phiblack

Schoolboy, many thanks.

However, I did as was suggested by RescoCCC and it worked perfectly.

Phil

23 Dec 2011, 5:21 PM
#9
rescoccc avatar

rescoccc

Totally Zenned

Join Date:
May 2010
Location:
WA State
Posts:
1,700
Plugin Contributions:
2

Post #9 by rescoccc

phiblack:

Schoolboy, many thanks.

However, I did as was suggested by RescoCCC and it worked perfectly.

Phil

He's actually pointing out a different issue. Run your site through this tool and you'll get an idea of what he's talking about:

http://validator.w3.org

The best way to learn is to try stuff. But, back it up first.

23 Dec 2011, 9:12 PM
#10
phiblack avatar

phiblack

New Zenner

Join Date:
Jun 2009
Posts:
37
Plugin Contributions:
0

Post #10 by phiblack

Great Scott!!

I see what you mean....

Thank you all. Looks like some more reading and adjusting for me.

Phil