X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Menu Bar & Javascript (https://forum.x-cart.com/showthread.php?t=35151)

SystemSkins 11-02-2007 11:34 PM

Menu Bar & Javascript
 
I want to incorporate this javascript to my menu bar. Its a vertical menu script I got from DynamicDrive

Here it is in action on my website before X-cart
http://www.systemskins.com

In the past few days I that I have been learning how X-cart works it seams as though there is very little html around. Yet thie script would involve alot of html. or at least I think it would.

What page or pages would I have to edit to incorporate this script into X-cart?
Do I use regular <a href="www.mysite.com/product1.html"> tags?

What about tables? Or should I stay away from tables?

Any help or advice would be appreciated.

Thanks

Doug

dsoong 11-02-2007 11:41 PM

Re: Menu Bar & Javascript
 
You can use static HTML if you do not change/add category often. Put the html in skin1\customer\categories.tpl

SystemSkins 11-02-2007 11:50 PM

Re: Menu Bar & Javascript
 
Quote:

Originally Posted by dsoong
You can use static HTML if you do not change/add category often. Put the html in skin1\customer\categories.tpl


Oh you mean in the admin area... well, so far I have all the categories I'm going to need until I start adding more products. But then I'd have to modify the menu anyways, which I'm aware of.

SystemSkins 11-02-2007 11:57 PM

Re: Menu Bar & Javascript
 
The script comes with its own CSS files. Should I refrain from multiple CSS files on my site and just copy the values into skin1.css ?

carpeperdiem 11-03-2007 03:30 AM

Re: Menu Bar & Javascript
 
Quote:

n the past few days I that I have been learning how X-cart works it seams as though there is very little html around. Yet thie script would involve alot of html. or at least I think it would.

What page or pages would I have to edit to incorporate this script into X-cart?
Do I use regular <a href="www.mysite.com/product1.html"> tags?

What about tables? Or should I stay away from tables?

Doug,

Working backwards -- tables, use 'em if you want... xcart can nest them 8 layers deep at times... but most designers have been going to css and using divs -- this is well beyond the scope of this thread.

Yes, there is html within templates (lots of HTML!), BUT you will use Smarty to integrate your html to the xcart code...

FOR EXAMPLE:

the css/js menu you linked to can work in the categories -- but you'll have to figure out how to wrap it around the smarty category loop.

You need to get your head around how things are created and rendered and displayed...

In a stock store, in your home.tpl file, your categories are listed in this include:
{include file="customer/categories.tpl" }

SO, let's look at categories.tpl - the guts of the category display is:
Code:

{foreach from=$categories item=c}
<font class="CategoriesList"><a href="home.php?cat={$c.categoryid}" class="VertMenuItems">{$c.category}</a></font><br />
{/foreach}


There's html going on there... and smarty is wrapped around it. Smarty makes the loop (for each) and places the category ID into the html link. Then if there are more, it loops and keeps making links for you...

SO if your goal is to make a css/js popup for your categories, this is probabloy where you will integrate the css/js.

You really need to visit the template editing guide and get your head around webmaster mode. Everything is nested into something in xcart, and few people know every path of every template or function... but webmaster mode reveals all.

You can use static html if you really want to, but it is not practical for things like categories -- since these are generated dynamically, USE WHAT SMARTY GIVES YOU and loop around it.

May I suggest, before you do one of these popups, get your head around how the html and css and smarty all play nicely together in templates -- you MUST use webmaster mode or else you will be lost.

SystemSkins 11-03-2007 10:42 AM

Re: Menu Bar & Javascript
 
Carpeperdiem

Thanks for helping clear that up. I understand it better, not completely, but better. I have gotten the script installed into x-cart and im now working on adding smarty into it, like links, and such. I'll post my code when i'm done and you can critique it for me. (if you wouldnt mind).

dsoong 11-03-2007 10:55 AM

Re: Menu Bar & Javascript
 
Using static HTML only affect one tpl file, and you can upgrade and back out easily. You don't even need to know Smarty, or PHP. It will also not run slower if you have large number of categories. Most importantly, one can implement/debug a static category faster. The main drawback is you need to change the static file when you add or remove category. You can ask yourself how many times will you do that? If you are using excel to keep track of categories, wirte a fomula to generate the HTML in one column. It will just be copy and paste.

SystemSkins 11-03-2007 10:58 AM

Re: Menu Bar & Javascript
 
Quote:

Originally Posted by dsoong
Using static HTML only affect one tpl file, and you can upgrade and back out easily. You don't even need to know Smarty, or PHP. It will also not run slower if you have large number of categories. Most importantly, one can implement/debug a static category faster. The main drawback is you need to change the static file when you add or remove category. You can ask yourself how many times will you do that? If you are using excel to keep track of categories, wirte a fomula to generate the HTML in one column. It will just be copy and paste.


Yeah, thats just it. My categories are pretty much set for now. As the gaming industry adds new gaming consoles then I'll have new skin kits to develop and sell. Which is pretty much on average only 1-2 every other year. I don't have a problem going in and manually adding them.

I was mainly concerned about load times and possible security holes.


All times are GMT -8. The time now is 11:11 AM.

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