Personal tools
You are here: Home Documentation How-tos Creating links to content
Support

Get Help

Join our chat rooms or support forums if you have more specific questions.

Plone Training
Learn how to design, build, and deploy a website in Plone through one of the numerous Plone training sessions around the world.
Find Plone training…
 
Document Actions

Creating links to content

This How-to applies to: Any version.
This How-to is intended for: End Users

How to link to resources located inside and outside the site.

Linking to other documents and folders is easy in a Plone site. The syntax you will use to create the link depends upon whether you are using the default editor or the visual editor.

This applies to most content types, such as Documents, Events or News Items, where you can enter free text. If you simply wish to create a content object which links to an internal or external resource, you can use the Link content type.

Visual Editor

If you are using the visual editor, you can to create a link as follows: highlight the text that you would like to have linked, and then click on the link icon in the toolbar of the visual editor window (it looks like a couple of chain links). Then, if the object you are linking to is inside the site, you can browse to it using the popup window that appears. If the object is outside the site, you can type in the URL or file location.

Use this syntax to point to a web address :

      http://www.foo.com

Linking to an email address is simple, too. Simply type in the phrase "mailto:" followed by the email address you would like to link to. For example :

      mailto:someone@foo.com

Default Editor

If you are using the default editor, then you have the option of using "structured text" formatting or HTML formatting. (Plain text is also an option, but you can't make links in plain text, so it wouldn't be a good one to choose in this case.)

Structured Text

To create a link in structured text, simply put the link phrase in quotes, follow it by a colon and follow that with the address of the object you are linking to.

For example, typing this :

        "Some Web Address":http://www.foo.com

Will get you this:

Some Web Address

To make an internal link to a resource on your own site, just use the path to the resource instead of a web address. For example, if you have a document called ContactUs in the about folder of your plone site, then typing this :

         "Click here to contact us":/about/ContactUs

will get you this:

Click here to contact us

If you supply only the short name, instead of the path, Plone will generate a relative link. In the above case, this means :

      "Click here to contact us":ContactUs

This comes out as follows:

Click here to contact us

Look closely at the URL that link points to, and you'll see the difference. Note that as long as the ContactUs page is in a parent folder of the current page, the link will still work, as Zope finds the resource using the mechanism of acquisition .

HTML

To create the same link in HTML would look like this :

        <a href="http://www.foo.com">Some Web Address</a>

Of course, since the text format you choose affects the entire document, if you want to use HTML for your links, you will also need to create the rest of your page in HTML. Likewise, if you use structured text for your links, you will also need to pay attention to structured text rules for the rest of your document. (If you insist, you can mix HTML in with your structured text, but don't be surprized if this makes it harder to edit later on.)

reStructuredText

In reStructuredText, the named link would have to be created like this:

     This is `Some Web Address`_ in my text.

     .. _`Some Web Address`: http://www.foo.com

That's nice if you want to refer to Some Web Address many times in the course of a document. If it's just a once-off link, it's quicker to write:

    `Some Web Address <http://www.foo.com>`_

by Alan Runyan last modified February 6, 2006 - 12:47 All content is copyright Plone Foundation and the individual contributors.

how to open links in a new window?

Posted by Asen Quintana at November 24, 2006 - 11:10
I would like to know how to customize this . Thanks

Opening links in a new window

Posted by Bob Shelton at September 15, 2007 - 22:24
In HTML, you can do this:
<a href="http://blah.blah.org" target="_blank">Link text</a>

Can I Build An Image Map

Posted by Mark Haggerty at July 3, 2007 - 11:15
If the answer is yes, how can I do it? Must I use an add on product, and if so, which one?

create link to a folder

Posted by Brien Villamiel at August 3, 2007 - 04:02
Is it possible to create a link to a folder?


For any issues with the web site functionality, please file a ticket.

Please consult the policy on plone.org content if you want your content published on this site.

Servers and hosting by