| ||||||||||
![]() |
Shopping cart software Solutions for online shops and malls | |||||||||
![]() |
![]() |
|
X-Cart Home | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Ui tabs different colour | |||
![]() |
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
![]() I've recently put the full product description in a tab and installed custom product tabs mod. I want to make one of the tabs a different colour but can't work out how or if it can be done. I've tracked done the UI jquery css file and have found this line that controls the default tab state: Code:
I can see that each tab has an href anchor id to target the tab content: Code:
can anyone tell me if it's possible to create a style that just targets that button/tab? I've tried but failed and it's frustrating me. The page that this is on is: http://www.mathmoseurope.eu/mathmos-astro-1227-0.html and the tab I want a different colour is the 'Colours / Buy' tab. any help would be much appreciated
__________________
4.4.3 |
|||||||
#2
|
|||||||||
|
|||||||||
![]() Martin,
I think the best way would be to change the way the tabs are called, adding a class to that particular tab. I don't have the custom tabs module to check, but I expect there is a php file that defines the tab and passes it to the template. I also imagine that you have an admin interface to assign new tabs. To do this properly I think you would need to add to the admin interface a place for class, create a field in the database to hold the class name, reference that field in the php file that builds the tab, and finally assign the class in the template. Not an easy task.
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey XcartGuru X-cart Tutorials | X-cart 5 Tutorials Check out the responsive template for X-cart. |
|||||||||
|
#3
|
|||||||
|
|||||||
![]() ouch
I think I was hoping for a css trick/miracle but you've confirmed my thoughts, thanks
__________________
4.4.3 |
|||||||
#4
|
|||||||||
|
|||||||||
![]() Quote:
You could try assigning the CSS you want using the last child psuedo selector. http://quirksmode.org/css/selectors/firstchild.html You can also get some similar result using Javascript. http://stackoverflow.com/questions/1329841/changing-css-for-last-li And finally you can do it with Smarty. http://www.smarty.net/forums/viewtopic.php?p=65372 Since this is X-cart 4 and we have Smarty, I would try that solution first. Your template may be different, but mine is: /ideal_responsive/customer/main/ui_tabs.tpl I see this code: Code:
Code:
You can see it working fine on my test site: http://trainingpen.com/product.php?productid=17515 -warning this site gets reloaded frequently, example might not exist in the future. So I didn't suggest this because I was thinking that it would only work for first or last, but now that I think more about it, you could assign any color to any tab you want this way, based on the index of the foreach loop. Sorry I didn't see this immediately, and worried you unnecessarily.
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey XcartGuru X-cart Tutorials | X-cart 5 Tutorials Check out the responsive template for X-cart. |
|||||||||
|
#5
|
|||||||
|
|||||||
![]() ahaaa great!
that looks perfect, the uitabs.tpl looks the same so I'll give it a go and let you know. many thanks
__________________
4.4.3 |
|||||||
#6
|
|||||||
|
|||||||
![]() this works really well and your help was spot on apart from one thing that I stupidly didn't think of......sometimes I don't want the last tab to be a different colour, only pages with the 'Colours / Buy' button.
I've amended the if statement to include product id so that only a product that is last and has product id xxxxx gets the different colour button. do you know how I can add multiple product ids to the if statement? I can't get it to work? here's what I have: Code:
I want to have it so that it has more than one product id so something like: Code:
any ideas? We only have a finite amount of products so I'm happy with quite a mechanical rule like this (i.e. specifying the ids individually) unless you can see another way? again many thanks for your help it's really appreciated
__________________
4.4.3 |
|||||||
#7
|
|||||||
|
|||||||
![]() don't worry I worked it out, excuse my laziness, I just used:
<li{if (($smarty.foreach.product_tabs.last)&&($product.pr oductid eq "17516" or $product.productid eq "17515"))} class="last_tab"{/if}><a href="#{$prefix}csi-{$tab.tabid}">{$tab.title|wm_remove|escape}</a></li> again many thanks!!
__________________
4.4.3 |
|||||||
|
|
|||
X-Cart forums © 2001-2020
|