X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Third Party Add-Ons for X-Cart 4 (https://forum.x-cart.com/forumdisplay.php?f=45)
-   -   PhilJ's Advanced Speedbar - Smarty question re: id="current" - $main eq "X" (https://forum.x-cart.com/showthread.php?t=28560)

mikeynuts 02-04-2007 03:56 PM

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 :)

shan 02-05-2007 07:41 AM

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

carpeperdiem 02-05-2007 08:15 AM

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

shan 02-05-2007 08:20 AM

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


All times are GMT -8. The time now is 08:32 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.