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

beating my head against a wall over and over again

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 09-07-2011, 11:37 AM
 
dezzarray dezzarray is offline
 

Advanced Member
  
Join Date: Mar 2010
Posts: 42
 

Exclamation 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.
__________________
"Time flies like an arrow, fruit flies like a banana"
- Groucho Marx
xcart gold version4.4
Reply With Quote
  #2  
Old 09-07-2011, 03:02 PM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default 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.
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote

The following user thanks balinor for this useful post:
dezzarray (09-08-2011)
  #3  
Old 09-08-2011, 04:15 AM
 
dezzarray dezzarray is offline
 

Advanced Member
  
Join Date: Mar 2010
Posts: 42
 

Default Re: beating my head against a wall over and over again

blah!! hardcoding! excuse me while i weep tears of fear and frustration
__________________
"Time flies like an arrow, fruit flies like a banana"
- Groucho Marx
xcart gold version4.4
Reply With Quote
  #4  
Old 09-08-2011, 04:50 AM
 
dezzarray dezzarray is offline
 

Advanced Member
  
Join Date: Mar 2010
Posts: 42
 

Default 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?
__________________
"Time flies like an arrow, fruit flies like a banana"
- Groucho Marx
xcart gold version4.4
Reply With Quote
  #5  
Old 09-08-2011, 05:01 AM
 
dezzarray dezzarray is offline
 

Advanced Member
  
Join Date: Mar 2010
Posts: 42
 

Default Re: beating my head against a wall over and over again

I'll bake you cookies
__________________
"Time flies like an arrow, fruit flies like a banana"
- Groucho Marx
xcart gold version4.4
Reply With Quote
  #6  
Old 09-08-2011, 05:14 AM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default 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
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #7  
Old 09-08-2011, 05:26 AM
  qualiteam's Avatar 
qualiteam qualiteam is offline
 

X-Guru
  
Join Date: Dec 2010
Posts: 6,373
 

Default 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); 
__________________
Alex Solovev,
Qualiteam

---

User manual Video tutorials X-Cart FAQ

You are welcome to press "Thanks" button
if you find this post useful

Click here to learn how to apply patches

X-Cart Extensions
Reply With Quote

The following 2 users thank qualiteam for this useful post:
Acquamarina (12-12-2011), pauline (08-08-2012)
  #8  
Old 09-08-2011, 05:28 AM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default Re: beating my head against a wall over and over again

Wow, didn't know that! That makes it even easier!
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #9  
Old 09-08-2011, 12:34 PM
  cherie's Avatar 
cherie cherie is offline
 

X-Wizard
  
Join Date: May 2003
Location: USA
Posts: 1,534
 

Default 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.
__________________
redlimeweb.com
custom mods and design integration
4.7 linux
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



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:23 PM.

   

 
X-Cart forums © 2001-2020