TinyMce forcing target="_blank" on pdf links with macros
Hi all,
I wonder if you can help me.
We basically have a requirement where we need to force all pdf links within the TinyMce WYSIWYG to open in a new tab.
Now this is fine, it works. I've created a user control on my template and passing in the property as a parameter. In the user control im using the HtmlAgilityPack tool to insert target="blank" for <a> tags linking to pdfs. I'm then binding to a .net literal control. This works perfectly well.
However, we also allow editors to insert macros into the WYSIWYG. The macros unfortunately are not being rendered, which makes sense because it wouldnt be hitting the server after binding to the literal control.
Has anyone had this probelm in the past? If so I would really appreciate some advice!
Maybe you can solve this with jquery? Check if the href attribute contains a pdf and if it does make sure it get's a target="_blank". Might be easier to do than the HtmlAgilityPack.
TinyMce forcing target="_blank" on pdf links with macros
Hi all,
I wonder if you can help me.
We basically have a requirement where we need to force all pdf links within the TinyMce WYSIWYG to open in a new tab.
Now this is fine, it works. I've created a user control on my template and passing in the property as a parameter. In the user control im using the HtmlAgilityPack tool to insert target="blank" for <a> tags linking to pdfs. I'm then binding to a .net literal control. This works perfectly well.
However, we also allow editors to insert macros into the WYSIWYG. The macros unfortunately are not being rendered, which makes sense because it wouldnt be hitting the server after binding to the literal control.
Has anyone had this probelm in the past? If so I would really appreciate some advice!
Maybe you can solve this with jquery? Check if the href attribute contains a pdf and if it does make sure it get's a target="_blank". Might be easier to do than the HtmlAgilityPack.
Jeroen
is working on a reply...