| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
Highlight current page in speedbar | ||||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||||
|
|||||||||
Highlight current page in speedbar
Hi there, currently I'm trying to highlight the speedbar link for the current page on which the user is. See the attached image to get my idea. So basicly when a user clicks on contacts in the speed bar, the contacts box link stays highlighted, which will make the menu more user-friendly. At first I thought this could be done with the active link property in CSS, but unfortunatelly it can't. So I've searched google and found out a way, but I'm not quite sure how to integrate this with X-Cart, so what we should do is assign id for the body of each page we have link to in the speed bar like this:
Code:
And after that for each link we must add a custom class like this: Code:
And then we must add the custom classes in our CSS like this: Code:
That sounds reasonable when we are dealing with HTML, but how to do this with X-Cart and Smarty. I really need this one and it is a feature, that everybody will enjoy. Can someone point me out to the right files that we need to edit and tell me how to adapt the code to use with this great shopping cart system?
__________________
Version 4.2.3 X-Cart Gold Version 4.3.1 X-Cart Gold |
|||||||||
|
#2
|
|||||||||
|
|||||||||
Re: Highlight current page in speedbar
Use $main, $help_section and $page_data and define css style "current" or wnatever you want to call it
{if $main eq "...."}, {if $help_section eq "contactus"}, {if $page_data.pageid eq "...."} Something like this <a href=""{if $help_section eq "contactus"} class="current"{/if}>Contact Us</a> <a href=""{if $page_data.pageid eq "5"} class="current"{/if}>Skin Care</a>
__________________
Steve Stoyanov CFLSystems.com Web Development |
|||||||||
#3
|
|||||||||
|
|||||||||
Re: Highlight current page in speedbar
Thank you, Sir. But in which file I should put this, and also all the links in my speed bar are links to categories in my site. So I'll be glad if you point me to the right file. Thanks in advance!
__________________
Version 4.2.3 X-Cart Gold Version 4.3.1 X-Cart Gold |
|||||||||
#4
|
|||||||||
|
|||||||||
Re: Highlight current page in speedbar
These will be your links so where you want them to appear thats where you put them. Not sure right now what the template for the speed bar links was called but if you look in head,tpl you should be able to find it. If links are based on categories you can use
{if $current_category.categoryid eq "xxx"}
__________________
Steve Stoyanov CFLSystems.com Web Development |
|||||||||
#5
|
|||||||||
|
|||||||||
Re: Highlight current page in speedbar
I can't find the speedbar links. I got as far as tabs.tpl:
Code:
__________________
Version 4.2.3 X-Cart Gold Version 4.3.1 X-Cart Gold |
|||||||||
#6
|
|||||||||
|
|||||||||
Re: Highlight current page in speedbar
These are the speed bar links. They are in an array called $speed_bar and the templates just loops trhough them. Put the if statement inside the <a>
__________________
Steve Stoyanov CFLSystems.com Web Development |
|||||||||
#7
|
|||||||||
|
|||||||||
Re: Highlight current page in speedbar
Code:
Something like this? How I should apply this for all of the 7 links and I know it sounds stupid but how can I get the category ID Thank you man, you are the one who is helping me since my fist post in this forum. I appreciate it, too bad I can't help you a lot with my poor knowledge...
__________________
Version 4.2.3 X-Cart Gold Version 4.3.1 X-Cart Gold |
|||||||||
#8
|
|||||||||
|
|||||||||
Re: Highlight current page in speedbar
you can get the cat id in the admin section.
just click on the cat and then the id will show in the URL
__________________
xcart 5.1.2 |
|||||||||
#9
|
|||||||||
|
|||||||||
Re: Highlight current page in speedbar
Quote:
__________________
Steve Stoyanov CFLSystems.com Web Development |
|||||||||
|
#10
|
|||||||||
|
|||||||||
Re: Highlight current page in speedbar
Thank you so much, that did the job!
PS: Is there a way to assign this current class to all subcategories in the main category, cause the highlighting disappears when I go into a subcategory?
__________________
Version 4.2.3 X-Cart Gold Version 4.3.1 X-Cart Gold |
|||||||||
|
|||
X-Cart forums © 2001-2020
|