This is a migrated thread and some comments may be shown as answers.

Radeditor removes download attribute

4 Answers 69 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Jim
Top achievements
Rank 1
Jim asked on 16 Mar 2017, 12:45 PM

I build websites using DotNetNuke and recently I had a need to force downloads from standard A tag hyperlinks. This can be done with modern HTML5 browsers using the "download" attribute. But, the RadEditor that the DNN site offers strips this attribute while in its standard HTML mode. The only way I can get it to work is to switch the editor into text mode, which causes issues when later opening / saving the content in HTML mode.

Is there any method to alter the behavior of the editor to accept / allow the "download" attribute?

Thanks.

4 Answers, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 16 Mar 2017, 01:55 PM

Hello Jim,

The only think that you can do is to disable the ConvertToXhtml filter. In XHTML every attribute should have a value that's why this filter strips it.

Best regards,
Rumen
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Jim
Top achievements
Rank 1
answered on 16 Mar 2017, 03:01 PM

Hi Rumen,

Is there any way to edit the XHTML filter settings to include "download" as a valid attribute within an "A" tag? I wouldn't think disabling the ConvertToXhtml filter altogether would be the best solution.

Thanks!

0
Rumen
Telerik team
answered on 16 Mar 2017, 03:09 PM
Extension settings

Hello Jim,

Unfortunately, there is no way to modify the filter and override it. You can file a feature request for this in the feedback portal.

Another approach is to add the download attribute to all A tags after obtaining the content as a string through the RadEditor1.Content server property.

Best regards,
Rumen
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Jim
Top achievements
Rank 1
answered on 16 Mar 2017, 03:51 PM

Thanks for the quick reply :-)

I tried out the sandbox at the link you provided and disabling the XHTML works, and it doesn't seem to cause too much conflict with the remaining tags. I think I'll just go with disabling it for now -- sometimes the simplest answer is the best solution ;-)

Tags
Editor
Asked by
Jim
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Jim
Top achievements
Rank 1
Share this question
or