I have some content on my entry like this:

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus quis rutrum dolor.

I know I can link to an Entry or Category, but I would like to link to an Asset. For example, a PDF.

I would like to highlight Lorem ipsum and link that text to a PDF. I can change over to HTML view and manually enter the link, but that seems risky to ask a client who may not know any HTML. Is there a preferred way to select some text and link it to an asset?

up vote 12 down vote accepted

This isn't really related to Craft specifically, but to allow a user to link to an asset, you will need to enable the feature in the redactor configuration file.

For example, within this file:

/craft/config/redactor/Standard.json

You will see something like this:

{
    "buttons": [
    "html",
    "formatting",
    "bold",
    "italic",
    ...

You will need to add file to that list so that it looks like this:

    {
    "buttons": [
    "html",
    "formatting",
    "bold",
    "italic",
    "file"
    ...

Make sure to clear out your cache to make sure that Craft can see your updated file.

Now when you highlight some text, you can choose "file" and then select an asset from one of your asset sources.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.