I know that Markdown in its basic setup doesn’t support coding links that will open the referred site in another browser tab. I tried several HTML-workarounds but none of them worked correctly after publishing the blog page with the link. Is there a way to realize what I want in Elements’s Markdown files? Or is this another flaw of using Markdown for blogging?
Markdown itself can’t open links in a new tab. The usual trick is to drop down to a little bit of HTML inside the Markdown file. Give this a go…
<a href="https://example.com" target="_blank">Example link</a>
Hope that helps.
Thanks for the hint, Dan. I’ve been trying getting my blog working for more than two months. This HTML-formatting was one of the things I tried already and it didn’t work. In one file it rendered as text, in another as link. Creating links that open in a new tab is of the frustrating things I had to deal with because Elements uses Markdown.
Because of your hint I tried it again and, yes, now it works. But I still don’t understand why. I suspect it has to do with the project templates I’m using for my website. And so with all the coding the developer adds which I’m not able to see nor understand. Could that be the cause of all my irritation?
The first project template I used was Ascent. This was not developed for blogging and it caused a several problems when I started to use the CMS. I suppose my link problem showed up in this project template, but I’ve got no active memory on that
(a saying from our former Dutch leader Mark Rutte when he was in political trouble
). With this project previewing related blog posts in Safari was impossible too.
The second project template is the one I’m using now. That is the Maximilan project, especially designed for blogging. And now HTML-linking works as expected. And so does previewing blog posts and related posts. Could my suspicion be right that it has to do with different project templates? This should not be the case, don’t you think so? The CMS and the components are the same, so it should also be working with Ascent I think.
I’m getting so irritated by this MD-mess by now, that I hope that you @dan or @ben will spend some real time looking at the CMS and MD problems that we as bloggers encounter. Sorry for my harsh tone but using Elements CMS for blogging is getting so annoying.
I followed your tip for opening links in a new tab. Below are two fragments from the same MD-file (see attached file).
The first one is in paragraph 2: ‘De wens om mij aan te sluiten bij de <a href=" De dominicaanse familie | Dominicanen " target=_blank">lekendominicanen past hier dan ook goed bij.’
The second one is in paragraph 4: ‘stammen uit dit interview op de website van de jezuïeten.’
In Elements their coloring is exactly the same: the link is blue, target is red and the a’s are brown. But in the browser they render differently:
The link in the first one is rendered as plain text without the at the end. So there’s no clickable link at all. The second one is rendered as a proper link and it works as it should.
There are other links in my MD-file too (see attached file paragraph 5), that are colored differently although the syntax is right. In these cases the links are colored red. And they are rendered as a proper link but clicking them results in a “Not found” message.
So what’s happening? Am I doing things wrong? Is there a bug? Anything else? You can find the blog page here: Thuismonnik blog and the post is called “Waar is God?” If the fault is mine, I apologize but I don’t see it.
2022-02-04-waar_is_god.md (4.5 KB)
There’s a broken link in your html, fix that and it’ll work for you!
Broken link (line 24)
target=_blank"is missing the opening quote.- Should be:
target="_blank".