Inserting HTML into Custom Fields

11 years 8 months ago #1147 by staticwave
Inserting HTML into Custom Fields was created by staticwave
First of all, I have been very happy with Store Locator.

I tried to enter an img tag in the Custom Field input, but when I save it is always deleted/filtered. I am SuperAdmin and have all filtering turned off.

Is there a way to change the Custom Fields input type to accept HTML without stripping?

Also, this might be very useful to others as well - maybe it can be added to future releases?

Any help would be appreciated, thanks.

Please Log in to join the conversation.

More
11 years 8 months ago #1148 by sysgenmedia
Replied by sysgenmedia on topic Inserting HTML into Custom Fields
we do not do any HTML filtering... Most likely the cause is the TinyMCE editor that comes with joomla. Check the plugin settings. You can try temporarily disabling the editor and see if that helps. We have good success with replacing the built-in editor with JCE.

Please Log in to join the conversation.

More
11 years 8 months ago #1149 by staticwave
Replied by staticwave on topic Inserting HTML into Custom Fields
Thanks for your reply. I don't use TinyMCE, I use CodeMirror. I I believe I have filtering turned off for TinyMCE, though. Would TinyMCE still filter in that case? Any other suggestions? Thanks for the help.

Please Log in to join the conversation.

More
11 years 8 months ago #1150 by staticwave
Replied by staticwave on topic Inserting HTML into Custom Fields
I completely disabled TinyMCE and it is still stripping any HTML. Maybe the input field type for the custom fields is the problem (i.e. being a text field instead of a text area)?

Where (in what file) can I change the type of input field is assigned to the Custom Fields?

Please Log in to join the conversation.

More
11 years 8 months ago #1151 by sysgenmedia
Replied by sysgenmedia on topic Inserting HTML into Custom Fields
Ohhh, i thought you were using the WYSIWYG field. The custom fields currently strip out all HTML. This can be overridden in administrator/components/com_storelocator/models/locateplace.php around line 123. You can see where we allow html for the Full address field. This can be replicated for other fields at this point.

Please Log in to join the conversation.

More
11 years 8 months ago #1155 by staticwave
Replied by staticwave on topic Inserting HTML into Custom Fields
Thanks for your help, the HTML is no longer stripped from the Custom Fields. However, the element is just passed as a string to the component (see screenshot). Any ideas on how to correct this?

Also, after re-opening the location record in the admin the custom field which had the HTML element inside is buggy (see screenshot). I don't have a problem with this as long as the element is passed correctly to the component, however I though it may assist you in diagnosis.

Thanks!

Attachments:

Please Log in to join the conversation.

More
11 years 8 months ago #1162 by sysgenmedia
Replied by sysgenmedia on topic Inserting HTML into Custom Fields
Well its mostly because it wasnt designed to do this... But you'll need to change the fields in the admin area to text areas like the full address field. And you'll need to change the template to renter the text as html rather than converting it to be shown as html

Please Log in to join the conversation.

More
11 years 3 weeks ago #1661 by onestyling
Replied by onestyling on topic Inserting HTML into Custom Fields

sysgenmedia wrote: Well its mostly because it wasnt designed to do this... But you'll need to change the fields in the admin area to text areas like the full address field. And you'll need to change the template to renter the text as html rather than converting it to be shown as html


I have the same question - I was able to switch the 'cust1' field to show up with an HTML editor, but it still shows up as string in the box. What I'm trying to do is put in am interior image gallery of each location.

I am able to use the gallery somewhat properly in the full address, but it doesn't show up in the location bubble, only in the side bar... as you can see in the attached image.


Attachments:

Please Log in to join the conversation.

More
11 years 3 weeks ago #1665 by sysgenmedia
Replied by sysgenmedia on topic Inserting HTML into Custom Fields
The final piece of the puzzle i believe is in the following file:

components/com_storelocator/views/map/view.feed.php

You'll need to modify lines 154-158, so that they work like the full address field, so... for each line remove the function wrapping the fields called: $this->XMLClean.

Hopefully that will get you in the right direction.

Please Log in to join the conversation.

More
5 years 6 months ago #3682 by cefilios
Replied by cefilios on topic Inserting HTML into Custom Fields
The file listed in the previous message no longer exists at the location given. Can someone tell me where to remove "$this->XMLClean" now or provide another solution to the problem.

"The final piece of the puzzle i believe is in the following file:
components/com_storelocator/views/map/view.feed.php
You'll need to modify lines 154-158, so that they work like the full address field, so... for each line remove the function wrapping the fields called: $this->XMLClean.
Hopefully that will get you in the right direction."

Please Log in to join the conversation.

  • cefilios
5 years 5 months ago #3699 by sysgenmedia
Replied by sysgenmedia on topic Inserting HTML into Custom Fields
The new file for Joomla 3.x is /components/com_storelocator/views/map/view.raw.php and the new lines are around 215-234.

Please Log in to join the conversation.

More