Does MarsEdit support popup titles for links?
  • I purchased MarsEdit yesterday and am beginning to compose posts within the program. One question that I cannot find an answer to in Help is whether there's a way to add titles to links inside posts as I can from within Wordpress. Is this possible?

    Thanks very much,
    Scott
  • Hi Scott - thanks for purchasing MarsEdit.

    MarsEdit's default link command doesn't yet support features like setting the title or declaring whether the link should open in a new window. I hope to support this by default in the future.

    In the mean time you could define a custom Formatting Macro to more or less achieve this:

    1. From the post editor, select Format -> Customize...
    2. Click the plus icon to add a new item.
    3. Name it e.g. "Link w/Title"
    4. For the opening HTML put:

    <a href="#askurl#" title="#asktext Title#">

    5. For the closing HTML put:

    </a>

    6. Optionally give it a keyboard shortcut.

    Now you have a Format menu item that will ask you first for a URL and then ask you for a title, using that data to build the desired link.

    Hope this helps!
    Daniel
  • Thanks for explaining the custom macro capability. It provided a good workaround for my need to insert 'target="blank"' within the tag. If the standard link macro could provide that as an option in the future, it would be great.

    Thanks!
    Mark
  • By the way, I certainly appreciate your responsiveness.

    Thanks,

    Mark
  • I'm glad the answer helped you out as well. I definitely hope to include this as a standard functionality as some point.
  • Just wondering if this is simpler to implement if instead of the various link options you allowed CSS class wrapper's for the links - one for images and one for text?
  • colinrc - it sounds like a good idea. But for the time being this seems like it would only be slightly less tedious for average users than the existing capability to completely customize the link HTML?
  • Oops, I posted this in the wrong topic - I meant to post it against new target windows for links. The main thing I'm trying to achieve is a different link wrapper for images, I looked at macros but I don't think there is any way to load an image into a macro?

    The comment still applies, and you are probably right - a class element with associated CSS is fairly close to editing the HTML for most users.
  • Hmm. I'm trying to solve it using the macro's with the image browser and javascript, it seems that any time I add javascript to the entry it gets removed?

    I tried adding it in HTML edit mode as well and the same thing happened. Is there any way I can escape the code or something to avoid it being removed ?

    This is the javascript I'm trying to add.
    onclick="return hs.expand(this, {slideshowGroup: 1 })"
  • Hmm, it's possible that the MarsEdit rich editor is removing the onclick attribute. I will have to look into this. Unfortunately, if that is the case then I think the only workaround would be to edit in HTML Text mode, where whatever HTML you want will be inserted and not subjected to the "normalization" of the RIch Text editor.

    I will add it to my list to look into whether the Rich Text editor could preserve the onclick attribute on nodes. It seems like it should, but there are many nuanced behaviors of the rich editor.
  • Thanks for the reply.

    It seems the editor is; I have tried a trick I saw on the forum - wrapping the tag in PRE so that it is more left alone. That worked for the HTML view but not the macro editor - it must try harder to 'sanitise' the html
  • When you say HTML view do you mean literally the "HTML Text" mode? Or the Rich Editor? In HTML Text mode your text should never be sanitized at all, even if it's coming from a macro. Let me know if it seems like the sanitizing is affecting even HTML Text mode. Thanks!
  • Finally resolved!

    Firstly,you were right - HTML mode does leave things alone, but I didn't want to use it for every image.

    The solution is quite involved so I have written it up in a blog post; but basically it involves a plugin to change the HTML on post and adding a keyword to the macro.


    http://www.colincanfield.me/words/2013/how-to-add-custom-javascript-to-images-when-using-marsedit-for-wordpress-on-a-mac/


    Thanks for a great editor!
  • Thanks for writing up the blog post. I am glad you found a solution even if it was a bit convoluted! Hopefully I can fix the sanitizing from the Rich Editor soon.
Start a New Discussion

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!