- Posts: 69
- Thank you received: 1
HTML within a filter custom field does not work
- dkmetz@taylorbruce.com
-
Topic Author
- Offline
Less
More
11 years 4 months ago #205944
by dkmetz@taylorbruce.com
______________
Dennis Kmetz
-- HikaShop version -- : 2.4.0
-- Joomla version -- : 3.3.6
-- PHP version -- : 5.5.25
Hi,
My filters are all working except for filters where I need to enter HTML code... here is my situation:
1. my records have been imported with a custom field called Temperature with values like
600<sup>o</sup>F
800<sup>o</sup>F
etc.
2. this data is preserved in the export... and looks exactly like the above... so far so good
3. when displayed on a web page, the above looks proper... and upon inspection I can see the html code... good so far...
4. the radio button custom field PIE CHART that appears at the bottom of the custom field entry form has values that look valid... that is, the pie chart slices are accurate, and the data to the right of the PIE CHART for the custom field looks like the above... followed by the number of records for each... so it looks like this for example:
600<sup>o</sup>F(6)
800<sup>o</sup>F(9)
etc.
These numbers look accurate.
My issue is that I cannot enter the above values into the custom field VALUES fields.
This custom field is a radio button. When I enter 600<sup>o</sup>F the value changes to 600oF when I save the field... and of course the filter does not work.
How do I enter HTML into the VALUES field of a radio button custom field to allow me to filter on this value?
Thanks,
Dennis
-- Joomla version -- : 3.3.6
-- PHP version -- : 5.5.25
Hi,
My filters are all working except for filters where I need to enter HTML code... here is my situation:
1. my records have been imported with a custom field called Temperature with values like
600<sup>o</sup>F
800<sup>o</sup>F
etc.
2. this data is preserved in the export... and looks exactly like the above... so far so good
3. when displayed on a web page, the above looks proper... and upon inspection I can see the html code... good so far...
4. the radio button custom field PIE CHART that appears at the bottom of the custom field entry form has values that look valid... that is, the pie chart slices are accurate, and the data to the right of the PIE CHART for the custom field looks like the above... followed by the number of records for each... so it looks like this for example:
600<sup>o</sup>F(6)
800<sup>o</sup>F(9)
etc.
These numbers look accurate.
My issue is that I cannot enter the above values into the custom field VALUES fields.
This custom field is a radio button. When I enter 600<sup>o</sup>F the value changes to 600oF when I save the field... and of course the filter does not work.
How do I enter HTML into the VALUES field of a radio button custom field to allow me to filter on this value?
Thanks,
Dennis
______________
Dennis Kmetz
Please Log in or Create an account to join the conversation.
- dkmetz@taylorbruce.com
-
Topic Author
- Offline
Less
More
- Posts: 69
- Thank you received: 1
11 years 4 months ago #205946
by dkmetz@taylorbruce.com
______________
Dennis Kmetz
Replied by dkmetz@taylorbruce.com on topic HTML within a filter custom field does not work
PS.
I tried entering the values with quotes... both single and double quotes. The quotes remain, but the text is change exactly like the above, for example "600<sup>o</sup>F" changes to "600oF" when I save the field.
Dennis
I tried entering the values with quotes... both single and double quotes. The quotes remain, but the text is change exactly like the above, for example "600<sup>o</sup>F" changes to "600oF" when I save the field.
Dennis
______________
Dennis Kmetz
Please Log in or Create an account to join the conversation.
11 years 4 months ago #205948
by nicolas
Replied by nicolas on topic HTML within a filter custom field does not work
Hi,
Yes, that's normal. HTML is not allowed in custom field values.
Change the code:
to:
in the file administrator/components/com_hikashop/classes/field.php and that should allow HTML in values.
Yes, that's normal. HTML is not allowed in custom field values.
Change the code:
Code:
$field->field_value[] = strip_tags($title) . '::' . strip_tags($value) . '::' . strip_tags($disabled);
Code:
jimport('joomla.filter.filterinput');
$safeHtmlFilter = JFilterInput::getInstance(null, null, 1, 1);
$field->field_value[] = $safeHtmlFilter->clean($title,'string'). '::' . $safeHtmlFilter->clean($value,'string') . '::' . $safeHtmlFilter->clean($disabled,'string');
Please Log in or Create an account to join the conversation.
Time to create page: 0.058 seconds