Creating Links in Rich Text Fields

Video

Creating Links in Rich Text Fields

Transcript

Hi, I’m Jason from Dash Media and in this video we’ll be covering creating links in rich text areas of MODX. The easiest way to create a link is to start with the text that you actually want the link to be. We’re going to type “Click here” and if I highlight that and select “Insert Link” option from the link menu, we’ll get our link dialog box.

First of all, we’ve got three options. We can make a URL link, a Resource link, or an Email link. Notice, all of them have a text field which says, “Click here”, which is the text that I selected before I chose to insert the link. If we change our mind, I can edit that now and that will also change in the rich text area. URL and Resource have this extra option called “Open link in new tab”. If you check this it will force the link to open a new tab instead of changing the address that you’re currently on.

Let’s start with URL links. A URL link will basically take a user directly to the address that we’ve typed in the URL section here. Let’s just say I want to send someone to Google. I would copy the entire Google address and then past that into the URL box. That way whenever a user clicks this link they’re going to be connected directly to Google, and I want that to open a new tab as well so I’ll check the box. Now we can see that our link is blue and underlined, showing us that it is actually a link.

Clicking on the link will open a popout menu which has three different links. The first action here is where the link is going to take us when we click it on the website. Then we also have an edit and unlink option. Unlink basically removes the link on the text but leaves the text in the content.

If you wanted to test your link you can click the first option which will open a new tab and take us where this link is going to go once it’s on the website. Clicking on it, it’ll go straight to Google as we expected it to.

Let’s say I want to change this link so it’s no longer going to Google, but instead going to our blog page. Click on the edit section. Because the blog is one of our resources we have to change the URL option to Resource and MODX makes this really easy for us. What I can do is start typing the word “blog” and it will give us suggestions for pages on our website that match this. When I click on the “Blog #4” suggestion it’s actually going to change the value here to just the number, but that’s okay because that’s what MODX wants us to do. And while we’re here I’m going to change the text that it’s linking on to “Click!” and click “Save”. As we can see the label for our link has changes and if I click on it, what it shows us is technically a short code, which is basically the way that MODX keeps track of which pages you want to link to. All you really have to know here is that this number lines up with the resource ID number inside of our resources tree. We wanted it to go to the blog and we can see that it’s going to number four which is the blog.

The final type of link we can use is an email link. You can open the edit menu and change the link type to Email. It’s important to remember that with an email link, the email address you enter here is the email address that a user will right an email to when they click your link. You’ll want to put in your email address here and we’ll change the label to “Email me!” Now when a user clicks this link on your website it will open their mail program and automatically create an email addressed to the email address that we’ve already typed in here.

The last option we have is to unlink. If you click that you’ll see that the text will change from blue and underlined to normal again. Now it’s back to being normal text again, there’s no links left.

For more training videos visit DashMedia.com.au.