News:

Support the VirtueMart project and become a member

Main Menu

Alternative image mouse-over doesn't work in VM description

Started by aravot, October 29, 2010, 19:57:44 PM

Previous topic - Next topic

zanardi

This is because JavaScript is removed by default from product description. In ps_product::add and ps_product::update you have:


$fields = array ( 'vendor_id' => $vendor_id,
'product_sku' => vmGet($d,'product_sku'),
'product_name' => vmGet($d,'product_name'),
'product_desc' => vmRequest::getVar('product_desc', '', 'default', '', VMREQUEST_ALLOWHTML),
'product_s_desc' => vmRequest::getVar('product_s_desc', '', 'default', '', VMREQUEST_ALLOWHTML),
...


The mask "VMREQUEST_ALLOWHTML" strips anything except from HTML. If you change that into "VMREQUEST_ALLOWRAW" you will have your "onmouseover" effect.

So this behaviour is "by design", and not a bug. Should we change it? After all, if Joomla content allows this kind of JavaScript, why shouldn't we do that in product description?

I'd like to have other opinions.
--
Francesco (zanardi)
http://extensions.gibilogic.com
@gibilogic on Twitter


zanardi

If it's all the same for you i'd like to have some more opinions. I'll ask that in the chat.
--
Francesco (zanardi)
http://extensions.gibilogic.com
@gibilogic on Twitter


deannak

I was trying to add JavaScript to VM descriptions and ran into the same problem, but I was doing it to set up some Google Optimizer tests.  It would be helpful to me if it didn't strip out the JavaScript.

deannak

One more note here...  I used your method above so that I could put the Optimizer javascript into the description like I need.  That worked like a charm - thanks!

But, I then noticed that the javascript code also ended up in my Meta Description on the final webpage, which of course is not really the description I'd want showing up anywhere.

Thanks!  This has been very helpful.