Direkt zum Inhalt | Direkt zur Navigation

Benutzerspezifische Werkzeuge
Sektionen
Sie sind hier: Startseite Artikel How to handle internal and external links

How to handle internal and external links

In plone it is possible to mark external links. With a bit of CSS these can be styled separatly. But you might struggle with internal links if you use other editors then Kupu.

With option "Mark external links" enabled in site setup (works with every editor)

<span class="link-external"><a href="...">...</a></span>

Ok, we have external links, but no internal. And putting a span tag around every a tag is kind of stupid in my eyes.

Editor handling

Kupu

<a class="external-link" href="...">...</a>
<a class="internal-link" href="...">...</a>

 

TinyMCE

<a href="...">...</a>

 

As long as TinyMCE does not add classes to internal and external links (why not?), we have to give every link a class to get this working properly. Add this to TinyMCE styles config to make it work:

Internal Link|a|internal-link
External Link|a|external-link

Because TinyMCE will replace Kupu in Plone 4, I hope that the link handling will make it into a future release.

 

CSS Styling

Now we have the classes we need to style our links:

a.internal-link {
    background: url(internal-link.png) no-repeat left center;
    padding-left: 15px;
}

a.external-link {
    background: url(link_icon.gif) no-repeat left center;
    padding-left: 15px;
}

a[href$=".pdf"] {
    background: url(pdf.png) no-repeat left center;
    padding-left: 20px;
}

 

Upate

With TinyMCE 1.1rc3 this issue has been fixed. There are now classes for internal links and mail links.

 

Artikelaktionen