Links are an essential part of each website. You can place links within any element with a rich text editor as a hyperlink and you can add a link which always leads to the top if the page, the toplink.
You can add links within the rich text editor in the text element. To define special links, with a specific layout or with an image acting as the link, you use the hyperlink element.
The following fields should always be addressed:
- Link target: the destination of the link, it can be an external URL such as https://contao.org or an internal link you can chose from the Contao site structure
- Open in new window: force the link to be opend in a new browser window or tab
- Link text: the word or phrase that will be displayed and act as the link
- Embed the link: a phrase to embed the link in the page by using "%p" as the wildcard
- Link title: the title attribute of the a-tag
- 6. Lightbox: forces the browser to open the link inside a lightbox. For this field to be available Mootools or jQuery has to be enabled in the page layout and a corresponding j- or moo-template has to be added
You can even use an image link by activating the checkbox "create an image link". Choose an image in the file manager, enter alternate text to be displayed when the image can not be displayed, enter an image title to be displayed with the image, set the title dimensions of the image and an optional caption.
The toplink element adds a link element leading to the top of the current page.
You just enter the link text to be displayed for this element.
You can see the element in action on the content element overview page.