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)
-   -   beating my head against a wall over and over again (https://forum.x-cart.com/showthread.php?t=60814)

dezzarray 09-07-2011 11:37 AM

beating my head against a wall over and over again
 
can someone, anyone tell me how to embed a rotating javascript banner INSIDE the category description and everytime I go to update it deletes all my delicious hard earned coding.

Heeeelp! I can only pick myself and throw myself into this brick wall so many times before I turn to the bottle and drown my sorrows.
](*,)

balinor 09-07-2011 03:02 PM

Re: beating my head against a wall over and over again
 
You can't add javascript to a database field like a category description. You'd need to hard-code it in the template and use {if} statements to only display it for that category.

dezzarray 09-08-2011 04:15 AM

Re: beating my head against a wall over and over again
 
blah!! hardcoding! excuse me while i weep tears of fear and frustration

dezzarray 09-08-2011 04:50 AM

Re: beating my head against a wall over and over again
 
would it be cheating if I ask perhaps ask what kind of if statement I need to do?

dezzarray 09-08-2011 05:01 AM

Re: beating my head against a wall over and over again
 
I'll bake you cookies

balinor 09-08-2011 05:14 AM

Re: beating my head against a wall over and over again
 
Use this as a reference:

http://forum.x-cart.com/showthread.php?t=8881

qualiteam 09-08-2011 05:26 AM

Re: beating my head against a wall over and over again
 
To allow javascript in category descriptions you should alter the "admin/category_modify.php" script and add:
PHP Code:

define('USE_TRUSTED_SCRIPT_VARS',1); 


right after:
PHP Code:

define('USE_TRUSTED_POST_VARIABLES',1); 


balinor 09-08-2011 05:28 AM

Re: beating my head against a wall over and over again
 
Wow, didn't know that! That makes it even easier!

cherie 09-08-2011 12:34 PM

Re: beating my head against a wall over and over again
 
Taking this one step further, I would put your javascript in a separate file so that you just add one line to the description. Then if you need to make changes to the banner you just do that in the js file without having to edit the description. :)


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

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