VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: manzanita on April 14, 2012, 02:27:08 AM

Title: Custom Field HTML Tooltip
Post by: manzanita on April 14, 2012, 02:27:08 AM
Is there a way to enable html in a custom field tooltip of description? Essentially, i want an image to display in the popup.

Thanks

Joomla! 2.5.4 + VM 2.0.4
Title: Re: Custom Field HTML Tooltip
Post by: manzanita on April 15, 2012, 05:35:28 AM
when i enter html it is not saved... so possibly the solution is simply changing the code so that the HTML is not stripped out?
Title: Re: Custom Field HTML Tooltip
Post by: manzanita on April 16, 2012, 13:04:46 PM
sorry to bump, looks like post get lost quickly here...

is there not anyone with insight into how this works?
Title: Re: Custom Field HTML Tooltip
Post by: manzanita on April 16, 2012, 13:06:01 PM
how about html in product description? Looks like html gets stripped out in the same way.
Title: Re: Custom Field HTML Tooltip
Post by: jenkinhill on April 16, 2012, 16:49:04 PM
No, code is not stripped in the full description and can also be applied in the short description (eg <b></b>. (using VM2.0.5rc)

The Tooltip text is sanitized - to change the way that works you would need to edit the core, which we do not support.
Title: Re: Custom Field HTML Tooltip
Post by: CRSparks on June 11, 2012, 22:38:42 PM
Hi Kelvin - I understand you do not support this, but could you please indicate which file I would need to modify to remove the "sanitization" code? I have a client for whom allowing HTML in the custom field description field is mission critical.
Title: Re: Custom Field HTML Tooltip
Post by: PRO on June 11, 2012, 22:42:36 PM
CRsparks,

what exactly do you want to do?

You are probably trying to go about this the long/wrong way.

Is this a cart variant? Or display?

Is the html a regular expression?

Title: Re: Custom Field HTML Tooltip
Post by: CRSparks on June 11, 2012, 22:49:19 PM
I have three variants. Two are are drop downs, one is radio options with graphics. To the right of each, the description text appears. What we need instead of text in the description field is a graphic linked to a pop-up. Each variant has a different accompanying graphic, so I cannot place the graphic by modifying the product details "flypage" file. So I need to "undo" the code which strips out the html in the description field.
Title: Re: Custom Field HTML Tooltip
Post by: PRO on June 11, 2012, 22:59:24 PM
CRSparks, this would be better done with a plugin
Title: Re: Custom Field HTML Tooltip
Post by: CRSparks on June 11, 2012, 23:31:57 PM
I agree, but I need to do this as a temporary measure to give a demo for some corporate bigwigs tomorrow.
Title: Re: Custom Field HTML Tooltip
Post by: CRSparks on June 12, 2012, 00:39:32 AM
The best I can figure is that code may be found in administrator/components/com_virtuemart/models/customfields.php - but I can't locate the line number.

Can anyone please help me locate the line of code that will enable html in the custom field description? I am in hot water with this client as it is with numerous VM2 issues, and this could sink me.
Title: Re: Custom Field HTML Tooltip
Post by: Rocked on September 07, 2012, 19:48:43 PM
I was searching for an answer to this, and just as I was about to hack the VM core... a more elegant solution occurred to me and I thought I'd share.

Use jQuery to add a class to the tool tip and whatever you were wanting to display as HTML -- just make with a background image!

It's really simple.  See http://jquery.bassistance.de/tooltip/demo/  -- see the "Tooltips with extra classes" section.  This solution worked great for me.