| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
PhilJ's Advanced Speedbar - Smarty question re: id="current" - $main eq "X" | ||||
|
|
Thread Tools |
#1
|
|||||||
|
|||||||
PhilJ's Advanced Speedbar - Smarty question re: id="current" - $main eq "X"
I am using a modified vesion of PhilJ's advanced Speedbar.
My goal is to get each TAB to HIGHLIGHT if it is the ACTIVE location. This is something PhilJ built into the code, but I decided to not use the {section name=sb loop=$speed_bar} -- rather, I am using a hard coded version for all my static pages. SO -- this killed the highlight active tab feature (excpet for the hard coded pages that are obvious...) So, for example, my home page link looks like this: http://www.mommymakeup.com Code:
I was able to figure out how to get the Gift Certificates link to work: Code:
Now, my goal is to have the rest of my static pages tell smarty who they are, so that I can trap for {if $main eq "current-page-name"}id="current"{/if} For example, how would I take this link and tell smarty that it is the current page? Code:
Note: I am using CDSEO for static pages, and we no longer use pages.php -- it has been replaced with the CDSEO equivalent, for my store it is named help.php I think I need to assign some kind of var to each static page, so that I can trap for it and use smarty in the speedbar. Can someone please share how this is done? Another example: My page "tips-n-tricks.html" is actually a static embedded page, /pages.php?pageid=3 -- BUT CDSEO allows me to call it, tips-n-tricks.html -- my question is: HOW CAN I tell this page that I want it to be called (to smarty) $tipsntricks ? Phil? Jon? Thanks! Jeremy
__________________
xcart 4.5.4 gold+ w/x-payments 1.0.6; xcart gold 4.4.4 |
|||||||
#2
|
|||||||
|
|||||||
Re: PhilJ's Advanced Speedbar - Smarty question re: id="current" - $main eq "X"
Moving to Third Party Add-Ons
__________________
Padraic Ryan Ryan Design Studio Professional E-Commerce Development |
|||||||
#3
|
|||||||
|
|||||||
Re: PhilJ's Advanced Speedbar - Smarty question re: id="current" - $main eq "X"
Padraic,
Had I phrased the question, "How can I tell smarty that a page is the current page, such as $main eq "thispage" " - would you have moved this to 3rd party? - this is really NOT about a 3rd party mod -- but overall Smarty. PhilJ just uses smarty in his code, and I have modified the daylights out of it and it has very little basis on Phil's code... My question is realy about smarty and how a page tells smarty who it is. I would hate for forum members to think this is specifically a 3rd party issue... it's about smarty. Can I re-post the question wihtout the reference to PhilJ's code and try again? Thanks, Jeremy
__________________
xcart 4.5.4 gold+ w/x-payments 1.0.6; xcart gold 4.4.4 |
|||||||
#4
|
|||||||
|
|||||||
Re: PhilJ's Advanced Speedbar - Smarty question re: id="current" - $main eq "X"
Both the subject and the body reference Phil's Speedbar...so naturally, I moved it to third party add-ons. In addition, you seemed to address the question to both Phil and Jon...why wouldn't I move this to Third Party Add-ons?
__________________
Padraic Ryan Ryan Design Studio Professional E-Commerce Development |
|||||||
#5
|
|||||||
|
|||||||
Re: PhilJ's Advanced Speedbar - Smarty question re: id="current" - $main eq "X"
OK -- please let it live for now -- if this doesn't get any attention in the next day(s) I'll re-post with a rewriteen question - and you can delete this, ok?
__________________
xcart 4.5.4 gold+ w/x-payments 1.0.6; xcart gold 4.4.4 |
|||||||
#6
|
|||||||
|
|||||||
Re: PhilJ's Advanced Speedbar - Smarty question re: id="current" - $main eq "X"
Your call...if it is not about a third party mod, I'll gladly move it to Template Editing...but it seems to address two specific third-party mods, no?
__________________
Padraic Ryan Ryan Design Studio Professional E-Commerce Development |
|||||||
#7
|
|||||||
|
|||||||
Re: PhilJ's Advanced Speedbar - Smarty question re: id="current" - $main eq "X"
Does this work?
Code:
The mod does cater for static pages, it's explained in install.txt
__________________
xcartmods.co.uk |
|||||||
#8
|
|||||||
|
|||||||
Re: PhilJ's Advanced Speedbar - Smarty question re: id="current" - $main eq "X"
Quote:
Yeah baby! You rock!! I read through install.txt again, but I missed this... I may have a very old version, Phil... My copy of Speedbar was from when you were selling it (not the free version). All I have in my install.txt is: Quote:
My issue is that I am not using the speedbar "automatic" fucntions -- and I am hard coding each link, so this does not apply. If I use the automatic code, I lose some flexibility (and CDSEO breaks) - so to keep my URLs that CDSEO makes for me, I chose to hard code the links. AND I like the flexibility. I gladly accept the responsibility that comes with hard-coding links. THANK YOU for coming up with this solution! PS -- how did you know this smarty var ($page_data.pageid eq) ? How could I have found this for myself? Thanks! Jeremy
__________________
xcart 4.5.4 gold+ w/x-payments 1.0.6; xcart gold 4.4.4 |
|||||||
#9
|
|||||||
|
|||||||
Re: PhilJ's Advanced Speedbar - Smarty question re: id="current" - $main eq "X"
In smarty.php (located in your root folder)...
Change... Code:
Code:
__________________
xcartmods.co.uk |
|||||||
#10
|
|||||||
|
|||||||
Re: PhilJ's Advanced Speedbar - Smarty question re: id="current" - $main eq "X"
Quote:
Cool... thank you. Then, you have to take a wild guess at the correct syntax For example, in webmaster mode, I can see the page_data and pageid vars -- so I guess it's just knowing how to assemble vars -- I've been reading the smarty doscs until my brain explodes, but I'll keep at it. Thanks for pointing me in the right direction. Everything works as desired now!
__________________
xcart 4.5.4 gold+ w/x-payments 1.0.6; xcart gold 4.4.4 |
|||||||
|
|||
X-Cart forums © 2001-2020
|