Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

PhilJ's Advanced Speedbar - Smarty question re: id="current" - $main eq "X"

 
Reply
   X-Cart forums > X-Cart 4 > Third Party Add-Ons for X-Cart 4
 
Thread Tools
  #11  
Old 02-04-2007, 03:56 PM
 
mikeynuts mikeynuts is offline
 

Advanced Member
  
Join Date: Jan 2007
Posts: 46
 

Default Re: PhilJ's Advanced Speedbar - Smarty question re: id="current" - $main eq "X"

Quote:
Originally Posted by PhilJ
In smarty.php (located in your root folder)...

Change...
Code:
$smarty->debug_tpl="file:debug_templates.tpl";
to...
Code:
$smarty->debug_tpl="file:debug.tpl";
Then turn on Webmaster Mode. It'll display every smarty variable at your disposal

wow that helps me out a ton... thanks
__________________
X-Cart Gold v4.1.9
Reply With Quote
  #12  
Old 02-05-2007, 07:41 AM
  shan's Avatar 
shan shan is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Birmingham, UK
Posts: 6,163
 

Default Re: PhilJ's Advanced Speedbar - Smarty question re: id="current" - $main eq "X"

One way you can assign things is to set anew variable in the php files.

There are not too many main php files that control everything else.

In the bottom of your php file add something like this

Code:
$smarty->assign("sub", "my_page_name");

now in your template use this

Code:
{if $sub eq my_page_name} Blah Blah {/if]

Its basically just allowing you to assign your own variable instead of using the built in {$main} one that xcart uses
__________________
Looking for a reliable X-cart host ?
You wont go wrong with either of these.

EWD Hosting
Hands On Hosting
Reply With Quote
  #13  
Old 02-05-2007, 08:15 AM
 
carpeperdiem carpeperdiem is offline
 

X-Guru
  
Join Date: Jul 2006
Location: New York City, USA
Posts: 5,399
 

Default Re: PhilJ's Advanced Speedbar - Smarty question re: id="current" - $main eq "X"

Shan,

I almost get it...

So in my case, the static embedded pages are all related to what was pages.php (now for me, due to CDSEO, help.php)

So in the php fie. I would add the line,

$smarty->assign("sub", "my_page_name");

I could call "sub" anything I want, yes?

What about "my_page_name" ? Does this have to match something in my static page? Do I add a line to the static page that tells smarty its page name?

And finally, I would do this for EACH page, yes?

Thanks!

Jeremy
__________________
xcart 4.5.4 gold+ w/x-payments 1.0.6; xcart gold 4.4.4
Reply With Quote
  #14  
Old 02-05-2007, 08:20 AM
  shan's Avatar 
shan shan is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Birmingham, UK
Posts: 6,163
 

Default Re: PhilJ's Advanced Speedbar - Smarty question re: id="current" - $main eq "X"

hi,

sub is the name of the variable i chose

my_page_name is what we assign to that variable

I was making a css nav menu and wanted to show what section i was currently in. eg help / products / checkout etc

so in help.php i would add assign sub to help etc.

this just allowed me to know what area of the site i was on as well as already having the value of {$main} if I needed to

help.php - deals with help type stuff
products.php & product.php dealt with most of the shop side of things
cart.php was mainly the checkout stuff

and so on
__________________
Looking for a reliable X-cart host ?
You wont go wrong with either of these.

EWD Hosting
Hands On Hosting
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Third Party Add-Ons for X-Cart 4



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 01:10 PM.

   

 
X-Cart forums © 2001-2020