Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • AB 29 posts 80 karma points
    Sep 04, 2013 @ 17:46
    AB
    0

    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!

  • Jeroen Breuer 4908 posts 12265 karma points MVP 4x admin c-trib
    Sep 05, 2013 @ 14:28
    Jeroen Breuer
    0

    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

Please Sign in or register to post replies

Write your reply to:

Draft