Block not accepting HTML code

I created a new block, selected HTML. When I go in to edit what I want, I click on the HTML icon in the top right of the new block. I put in:


You can't put JS in the HTML editor, it always strips it out. Strangely, you can actually drop it right into the corresponding database field and it renders on the front end just fine, but breaks again as soon as you edit the HTML block again.



For things like this I have always just created a custom template and put the code in there instead. Quick and easy to do.

You can also create a static template and add the code into tpl file, if you need extra info please tell me your cs-cart version and i will guide you





Valentin

Not really sure how to make a template to do that lol

what cs-cart version are you using ?

3.x (not sure exact revision)

[sub]Ok looks like 3.0.2 pro[/sub]

create a file [color=#ff0000]my_custom_code.tpl[/color] and add the custom html code inside ( if you are using [color=#ff0000]{[/color] or [color=#ff0000]}[/color] please add [color=#ff0000]{literal}[/color] at the beginning of file and [color=#ff0000]{/literal}[/color] at the end ) depending of you version :[list]

[]3.x Professional: [color=#ff0000]skins/[SKIN_NAME]/customer/addons/my_changes/blocks/static_templates/my_custom_code.tpl[/color]

[
]3.x Ultimate: [color=#ff0000]stores/[STORE_ID]/skins/[SKIN_NAME]/customer/addons/my_changes/blocks/static_templates/my_custom_code.tpl[/color]

[/list]

Add block > Create New Block (tab) > Template (block) and on select box choose [color=#ff0000]_my_custom_code[/color]



I hope that helps,





Valentin

[color=#808080][size=2]part of hungryweb.net[/size][/color]

Thanks. I will try it this afternoon =)

I get up to addons/my_changes, but I do not have a blocks folder after that. I just create the directory I assume?

Yes, and you need also to have addon My Changes turned active ;)



My changes addon is used in order to add extra functionality or change some and also used after an update ;) this is a free lesson :))

gave me some kinda error first try so tried again, works great =) Thanks alot. You have any hints on deleting a block? I have my old one I tried to make…I delete it, goes off the screen, but if I refresh the page, it comes back lol

[quote name='parodius420' timestamp='1375132357' post='166002']

gave me some kinda error first try so tried again, works great =) Thanks alot. You have any hints on deleting a block? I have my old one I tried to make…I delete it, goes off the screen, but if I refresh the page, it comes back lol

[/quote]

I assume you mean the block you tried to put the script code into? If so, whenever I have had this problem, I have went into the database and manually deleted the blocks content. Then it should delete no problem from within the Blocks page in the admin panel.

Stellar, yep thats correct. You talking about sql database? I dont feel too comfy working with that lol

[quote name='parodius420' timestamp='1375132357' post='166002']

gave me some kinda error first try so tried again, works great =) Thanks alot. You have any hints on deleting a block? I have my old one I tried to make…I delete it, goes off the screen, but if I refresh the page, it comes back lol

[/quote]

I had trouble managing blocks when using MS Internet Explorer browser. Switching to Firefox browser solved the problem.