WordPress.org

Forums

quicktags.js for rel="external" (6 posts)

  1. recog
    Member
    Posted 10 years ago #

    I'm trying to modify quicktags.js in WP1.5 to insert rel="external" into links that I create. I tried changing this line:

    edButtons[i].tagStart = '<a href="' + URL + '">';

    to this:

    edButtons[i].tagStart = '<a href="' + URL + '" rel="external">';

    but it doesn't seem to work. I've looked around the forums and not found the answer, but may have missed it. Please advise. Thanks,

    --recog

  2. JuneBleeds
    Member
    Posted 10 years ago #

    I edited my InsertLink function to actually prompt me for a relationship, just in case I'm not linking to something external and still want to assign one to it (don't ask why, but it seemed like a good idea at the time, heh). Perhaps you might find it useful. Also note that I have another prompt at the end to enter a title for the link... Yeah, I'm too lazy to manually add this stuff...

    Here's the code I'm using:

    edButtons[i].tagStart = '<a href="' + URL + '" rel="' + prompt('Enter a relationship for the link', '') + '" title="' + prompt('Enter a title for the link', '') + '">';

  3. recog
    Member
    Posted 10 years ago #

    Thanks. The ability to choose sounds great, as I don't want internal links to spawn a new window.

  4. JuneBleeds
    Member
    Posted 10 years ago #

    No problem, recog. Glad it worked out for ya. :)

  5. Lorelle
    Member
    Posted 10 years ago #

    This is great but where is the "InsertLink function" found?

  6. Jinsan
    Member
    Posted 10 years ago #

    i assume it's in the quicktags.js

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags