How would I have Custom fields containing HTML

  • Posts: 34
  • Thank you received: 0
11 years 4 months ago #14197

I tried this and single quotes get a double quote put in front of it and truncates my code (a fairly long 'a href' entry). I tried text and text area types.

Better still can a custom field be a text editor entry i.e JCE?


David Craig
Hikashop 1.5.0 Business edition
www.charitycanvasprints.com

Please Log in or Create an account to join the conversation.

  • Posts: 34
  • Thank you received: 0
11 years 4 months ago #14200

Sorry wrong sub forum, I meant to post it in 'How To?' Can you please move it or delete it and I will re-enter it?


David Craig
Hikashop 1.5.0 Business edition
www.charitycanvasprints.com

Please Log in or Create an account to join the conversation.

  • Posts: 76114
  • Thank you received: 11912
  • MODERATOR
11 years 4 months ago #14203

What kind of custom field field are you using and where do you have your HTML cut . On the front end or the back end ?
Which version of HikaShop are you using ?

Please Log in or Create an account to join the conversation.

  • Posts: 34
  • Thank you received: 0
11 years 4 months ago #14208

Tried using Text and Text Area Custom Field types

Purpose is to enter it in a custom field the products back-end page and display in the frontend. (Its a piece of HTML to display CC licence info and links to the licience and the author)

Version 1.4.8 business


David Craig
Hikashop 1.5.0 Business edition
www.charitycanvasprints.com

Please Log in or Create an account to join the conversation.

  • Posts: 76114
  • Thank you received: 11912
  • MODERATOR
11 years 4 months ago #14210

Before version 1.4.9 you could not insert HTML in custom fields. You should get the 1.4.9 version and install in over your current version to be able to do that.

Please Log in or Create an account to join the conversation.

  • Posts: 34
  • Thank you received: 0
11 years 4 months ago #14217

The back-end told me the 1.4.8 was the current stable version. I then went to your site and my order and downloaded and installed the latest, which was 1.4.9 even tho the software itself showed 1.4.8 was the current version.

I deleted my previous custom fields and created new ones.

It does not interpret single quotes correctly. If I have all double quotes in the HTML code then it is fine.

Another limit is that it only allows for VARCHAR i.e. 255 characters, very small for any HTML snipit


David Craig
Hikashop 1.5.0 Business edition
www.charitycanvasprints.com

Please Log in or Create an account to join the conversation.

  • Posts: 34
  • Thank you received: 0
11 years 4 months ago #14218

Example of single quotes not being written out correctly.

Code as entered:

<a href='http://creativecommons.org/licenses/by/2.0/' target='_blank'><img src='http://i.creativecommons.org/l/by/2.0/80x15.png' alt='Creative Commons Attribution 2.0 Generic License' title='Creative Commons Attribution 2.0 Generic License' border='0' align='left'></a>


After a save the code looks like this:
<a href="http://creativecommons.org/licenses/by/2.0/" target="_blank"><img src="http://i.creativecommons.org/l/by/2.0/80x15.png" alt="'Creative" Commons="Commons" Attribution="Attribution" 2.0="2.0" Generic="Generic" License'="License'" title="'Creative" Commons="Commons" Attribution="Attribution" 2.0="2.0" Generic="Generic" License'="License'" border="0" align="left" /></a>

I manually increased the field size VARCHAR custom field in the Db table and the code seems to handle the bigger size OK.


David Craig
Hikashop 1.5.0 Business edition
www.charitycanvasprints.com

Please Log in or Create an account to join the conversation.

  • Posts: 76114
  • Thank you received: 11912
  • MODERATOR
11 years 4 months ago #14231

In next version, we will change the creation of custom fields to have them as TEXT field instead of VARCHAR. That will allow more than 255 characters.

For the quotes in the HMTL, that's normal. When you add HTML in a custom field, the code is checked for XSS threats so that no one on your website will be able to mess with them. We use the filtering library of joomla for that and it has that behavior when checking the HTML.

Please Log in or Create an account to join the conversation.

  • Posts: 34
  • Thank you received: 0
11 years 4 months ago #14235

Thanks for that.
When doing your code change it would be good that if no custom fields were filled in for a particular product that the 'Specification' heading would also not show.

Sorry for posting in the wrong sub-forum as its not really a bug


David Craig
Hikashop 1.5.0 Business edition
www.charitycanvasprints.com

Please Log in or Create an account to join the conversation.

  • Posts: 76114
  • Thank you received: 11912
  • MODERATOR
11 years 4 months ago #14248

We'll look at doing that.

Don't worry. We have a lot of users posting bug reports which aren't :)

Please Log in or Create an account to join the conversation.

Time to create page: 0.069 seconds
Powered by Kunena Forum