Skip to main content
Solved

Universal HTML field with HREF, Target gets stripped?


Freddy
Forum|alt.badge.img+16
  • Thinkwise Local Partner Brasil
  • 531 replies

Hi. We made a custom HTML field for a card list and it shows attachments. 

Some are too big to show inline and we want to give them a link. This works.. but for some reason the target predicate  get stripped with the result that the link doesn't open in a new tab/window.  

How can we solve this?  Deep linking to a preview component is not supported yet right? 

Best answer by Leroy Witteveen

Hi @Freddy,

I see the cardlist and grid indeed behave differently.
In the form, the target attribute actually first gets stripped too, but after that every link will receive target=”_blank” so URLs open in a new tab.
The same should probably be done for the cardlist and grid.
Could you create a ticket for this in TCP please?

Kind regards,
Leroy

View original
Did this topic help you find an answer to your question?
This topic has been closed for replies.

4 replies

Leroy Witteveen
Moderator
Forum|alt.badge.img+3

Hi @Freddy,

Can you send an example HTML snippet in which the target attribute would be stripped?
If I insert the following HTML into the database and open it in Universal in a HTML control, it opens google.com in a new tab if I click the link:

<a href="https://google.com" target="_blank">Test</a>

I can also see in Chrome DevTools that it indeed stays intact:

 


Freddy
Forum|alt.badge.img+16
  • Author
  • Thinkwise Local Partner Brasil
  • 531 replies
  • June 7, 2022
Leroy Witteveen wrote:

Hi @Freddy,

Can you send an example HTML snippet in which the target attribute would be stripped?
If I insert the following HTML into the database and open it in Universal in a HTML control, it opens google.com in a new tab if I click the link:

<a href="https://google.com" target="_blank">Test</a>

I can also see in Chrome DevTools that it indeed stays intact:

 

Could it be that the card list behaves differently?

I get my attachments dynamically… with the TARGET mentioned. 

select pat.tenant_id
                    ,pat.activity_id
                    ,string_agg(iif(pat.attachment_type = 0
                                     ,'<a href="'+cf.s_url+'" target="_blank">'
                                       + '<img src="'+cf.s_url+'" height="80px" /></a>'
                                     ,'<ul><li><a href="'+cf.s_url+ '" target="_blank">'
                                       + pat.file_upload + '</a></li></ul>')
                                 ,'')   as attachments
                from process_attachment pat
                left join csc_variable fu
                  on fu.variable_code         = 'i_in_url_u'
               cross apply ( select replace(replace(fu.variable_value,'[tenant_id]',pat.tenant_id),'[attachment_id]',pat.attachment_id) as s_url
                   ) cf
               group by pat.tenant_id
                       ,pat.activity_id

and it gets stripped.:

 


Leroy Witteveen
Moderator
Forum|alt.badge.img+3

Hi @Freddy,

I see the cardlist and grid indeed behave differently.
In the form, the target attribute actually first gets stripped too, but after that every link will receive target=”_blank” so URLs open in a new tab.
The same should probably be done for the cardlist and grid.
Could you create a ticket for this in TCP please?

Kind regards,
Leroy


Freddy
Forum|alt.badge.img+16
  • Author
  • Thinkwise Local Partner Brasil
  • 531 replies
  • June 7, 2022
Leroy Witteveen wrote:

Hi @Freddy,

I see the cardlist and grid indeed behave differently.
In the form, the target attribute actually first gets stripped too, but after that every link will receive target=”_blank” so URLs open in a new tab.
The same should probably be done for the cardlist and grid.
Could you create a ticket for this in TCP please?

Kind regards,
Leroy

Done 85345


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings