Thank you and Best on You
Thank you and Best on You
Thank you,
Sully ![]()
Code: Select all
<div class="div4"><a href="<?php echo str_replace('&', '&', $home); ?>" id="tab_home"><?php echo $text_home; ?></a>Code: Select all
<div class="div4"><a href="http://www.yourdomain.com"><?php echo $text_home; ?></a>Free v1.4.9 Extensions: Default Specials | Improved Search | Customer Activity Report | Customer Groups | Royal Mail With Handling | Improved Product Page | Random Products | Stock Report | All Products
Good on You-
Sully
Thank you,
Sully ![]()
catalog/view/theme/YOURTHEME/template/common/header.tpl
...but the slightly tricky part would be changing:
catalog/view/theme/YOURTHEME/stylesheet/stylesheet.css
so that six tabs are resized to occupy the same space as the five current ones; otherwise, you will have to widen <div4> and change your template header design.
In the former case, you would also have to prepare new images:
catalog/view/theme/YOURTHEME/image/tab_1.png
catalog/view/theme/YOURTHEME/image/tab_2.png
which show the two states of the tab.
Free v1.4.9 Extensions: Default Specials | Improved Search | Customer Activity Report | Customer Groups | Royal Mail With Handling | Improved Product Page | Random Products | Stock Report | All Products
I've been doing simmilar thing, I have managed to change the name of the tag and its hyperlink (which is a specific category in the catalogue), but the problem is that the tag image is not changing to tab_2.png.
I can see that other unchanged tags get ---class="selected"--- part in the <a href> but the ones I changed don't get this.
To be more precise, I changed:
<a href="<?php echo str_replace('&', '&', $account); ?>" id="tab_cart"><?php echo $text_account; ?></a>
to:
<a href="http://www.mydomainname.com/index.php?r ... ry&path=36" id="tab_cart">Holiday</a>
How do I fix this?
Thanks
There are #header .div4 a { and #header .div4 a.selected { entries in the stylesheet, so tabs simply need to be <a> within <div4>
The state is set in javascript at the bottom of header.tpl
On the website I prepared, I have just also added different tab images on a particular tab just because I am learning css
This simply (although it took me more than half an hour to figure out) uses #header .div4 a#tab_account.selected { and #header .div4 a#tab_account.selected {
Free v1.4.9 Extensions: Default Specials | Improved Search | Customer Activity Report | Customer Groups | Royal Mail With Handling | Improved Product Page | Random Products | Stock Report | All Products
Of 5 tabs, I wanted to have:
Home (leave as is)
Login (leave as is)
Account (leave as is)
Cart (link to a category – but keep the name #tab_cart)
Checkout (link to a category - but keep the name #tab_checkout)
I can see now as you pointed out to me, the whole thing is happening in the java script at the bottom of header.tpl
And I am now stuck there. Any ideas how to change the java script so the 2 tags change background image when selected? Or do I need to create 2 new:
#tab_category1, and
#tab_category2?
But if I do, that will change quite a few other things?
Many thanks
The javascript in header.tpl simply looks at the current path and sets the class of the appropriate tab so you don't need any new images or stylesheet changes, you simply need to amend the script to include:
Code: Select all
if (route == 'YourFolder/YourModule') {
$('#tab_YourTab').addClass('selected');
}Free v1.4.9 Extensions: Default Specials | Improved Search | Customer Activity Report | Customer Groups | Royal Mail With Handling | Improved Product Page | Random Products | Stock Report | All Products
My problem is that I have 2 different tabs, but they both pointing to the same 'product/category' route but to 2 different category ID's
Not sure how to set (route == 'MyFolder/MyModule') for each separate category as they currently clash with each other ?
Code: Select all
path = getURLVar('path');
if (path == '36_47') {
$('#tab_account').addClass('selected');
} else { Code: Select all
$(document).ready(function() {
route = getURLVar('route'); Code: Select all
} Code: Select all
});
//--></script> and change #tab_account to the tab you want selected
You can use any of the url vars by changing the word path to the var you want to use
so for information change path to information_id and for products change path to products_id etc.
hope that helps
Users browsing this forum: No registered users and 13 guests