Skip to Content Skip to Menu

[SOLVED] html onerror not working in "Custom Display Rows"?

  • ericmuc
  • ericmuc
  • OFFLINE
  • Posts: 390
  • Thanks: 30
  • Karma: 2
  • Add-ons
4 years 3 weeks ago - 4 years 3 weeks ago #320749 by ericmuc
Hi,

In the display "Custom Display Rows" of a "field group" field I added:
Code:
<a href="[cb_cv_company_url]" target="_blank"><img class="cb_cv_company_logo" src="https://logo.clearbit.com/[cb_cv_company_url]" onerror="this.src='/images/commercial-icon.png'"></a>

The onerror function should work: if clearbit sends no logo, an own image is shown. But I get an 404 error, onerror doesn't work. And all efforts to solve this didn't do it.

My question: is there something I have to do because the code is in "Custom Display Rows" of a "field group" field? Have you a hint, what I can do?

A test in my website on another page shows this code working!

Thanks a lot, best regards
Eric
Last edit: 4 years 3 weeks ago by krileon. Reason: Added [SOLVED] tag to subject

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48435
  • Thanks: 8275
  • Karma: 1443
4 years 3 weeks ago - 4 years 3 weeks ago #320760 by krileon
Those parameters have HTML filtering applied to them. This removes any potential dangerous HTML. You'd need to use a custom template to do what you're wanting, which will allow you to use whatever PHP or HTML you like. Will review allowing RAW output for those parameters since they're strictly admin supplied.

forge.joomlapolis.com/issues/8181


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
Last edit: 4 years 3 weeks ago by krileon.

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

  • ericmuc
  • ericmuc
  • OFFLINE
  • Posts: 390
  • Thanks: 30
  • Karma: 2
  • Add-ons
4 years 3 weeks ago #320773 by ericmuc
Hi,
Thanks. My question is now, how I can proceed?

I am using a field group in the profile. All is set right and is working with the right design. I don't want to add a custom template.

"Will review allowing RAW output for those parameters since they're strictly admin supplied."

Can I wait on a solution by you? That would be great.

Other idea: There are some solutions with javascript together with a css id, but would this be possible? I need to have the current url-fields of the shown profile to do that, is that possible?

Thanks, best regards
Eric

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48435
  • Thanks: 8275
  • Karma: 1443
4 years 3 weeks ago #320784 by krileon
Custom Display Rows and Custom Edit Rows are now using RAW filtering in latest CB Field Groups. Your usage should work fine after updating.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
The following user(s) said Thank You: ericmuc

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

  • ericmuc
  • ericmuc
  • OFFLINE
  • Posts: 390
  • Thanks: 30
  • Karma: 2
  • Add-ons
4 years 3 weeks ago #320787 by ericmuc
I almost miss the words, just super good, thank you very much for this really good support!
The following user(s) said Thank You: krileon

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

Moderators: beatnantkrileon
Powered by Kunena Forum