Links

We use relative links for links to pages within our website and absolute links for links to other peoples websites. Find out how to do create links in different contentful models.

On this page

Absolute or relative link?
How to create a link
Absolute url — linking to an external website
Relative url — linking to a National Libary page
Phone number link
Email links

In Contentful you can use either absolute or relative links to link to webpages.

Absolute links are used if you are linking to pages on other websites.

Relative links are used for links to pages on the National Library website.

The table below shows the content models and what they allow when you are creating links.

If you are linking to a National Library page once you have added the link edit it the markdown to create a relative link.

Absolute url Relative url
Content block Feature card
Feature image Short url
Info block
Page
Rights statement
Side block

Below is the markdown and some instructions for creating a link with an absolute url and a relative url.

Absolute url — linking to an external website

You can add absolute links to the external webpages by either:

  • adding them with markdown
  • using the wysiwyg editor, click the link icon.
Markdown for creating a link to an external website with an absolute url.
Markdown for linking using an absolute url.

This is my linking text to an external website. I am using an absolute url


Relative url — linking to a National Libary page

You can add relative links to the National Library webpages by either:

  • adding them with markdown
  • using the wywiwyg editor and then editing the link

If you use the wysiwyg editor to add a link to a National Library page edit it in the markdwon to make it a relative link.

Markdown for creating a link to a National Library webpage with a relative url.
Markdown for linking using a relative url.

This is my linking text to a national library webpage. I am using a relative url.


You can create a link on a phone number. This lets people call us easily if they are using a mobile device.

Create the phone link with markdown:

  • type in the phone number
  • use this markdown [123-456-7890](tel:1234567890)
  • and voila 123-456-7890

Use this markdown to create an email link

Email markdown and example

Email [Michael.Brown@dia.govt.nz](mailto:Michael.Brown@dia.govt.nz)

Email Michael.Brown@dia.govt.nz

Email: [servicestoschools@dia.govt.nz ](mailto:servicestoschools@dia.govt.nz?subject=Book%20a%20school%20visit%20to%20He%20Tohu%20Tāmaki) to make a booking.

Email: servicestoschools@dia.govt.nz to make a booking.